Created
June 9, 2012 20:08
-
-
Save kdmukai/2902391 to your computer and use it in GitHub Desktop.
Adding a page with Java, Tiles, and JSP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> | |
<div class="rounded"> | |
<div class="page_title">Administrator Pilots</div> | |
This is the Administrator Pilot page. | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.essaytagger.web.user.administrator; | |
import java.io.IOException; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.apache.tiles.TilesContainer; | |
import org.apache.tiles.servlet.context.ServletUtil; | |
import com.essaytagger.web.user._BaseHttpServlet; | |
public class IndexServlet extends _BaseHttpServlet { | |
private static final long serialVersionUID = 1L; | |
@Override | |
protected void doGet(final HttpServletRequest request, | |
final HttpServletResponse response) throws ServletException, | |
IOException { | |
TilesContainer container = ServletUtil.getContainer(request.getSession().getServletContext()); | |
container.render("visitor.administrator_pilot.index", request, response); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<definition name="visitor.administrator_pilot.index" extends="visitor.template"> | |
<put-attribute name="title" value="Administrator Pilot" cascade="true" /> | |
<put-attribute name="body" value="/WEB-INF/tiles/visitor/administrator_pilot/index.jsp" cascade="true" /> | |
</definition> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servlet> | |
<servlet-name>AdministratorIndexServlet</servlet-name> | |
<servlet-class>com.essaytagger.web.user.administrator.IndexServlet</servlet-class> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>AdministratorIndexServlet</servlet-name> | |
<url-pattern>/administrator_pilot</url-pattern> | |
</servlet-mapping> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment