Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <definition name="cnmp.body.index" extends="cnmp.mainLayout" >
- <put name="title" value="CNM Portal" />
- <put name="bodytitle" value="Home" />
- <put name="body" value="/00-CNM_Landing.jsp" />
- </definition>
- public class TileForwardAction extends Action
- {
- public ActionForward execute(ActionMapping mapping, ActionForm arg1,
- HttpServletRequest arg2, HttpServletResponse arg3) throws Exception
- {
- return mapping.findForward("theTile");
- }
- }
- <action-mappings>
- <action path = "/index"
- type = "com.bellsouth.snt.cnmp.ui.action.TileForwardAction"
- scope = "request"
- input = "cnmp.body.index"
- parameter= "theTile"
- >
- <forward name="theTile" path="cnmp.body.index"/>
- </action>
- <% String destAttr=(String)request.getAttribute("dest"); %>
- <jsp:include page="<%=destAttr%>" flush="true" />
- request.setAttribute("dest", "landingB.jsp");
- <definition
- name="cnmp.body.index"
- extends="cnmp.mainLayout"
- controllerClass="org.yourpackage.YourControllerClass">
- <put name="title" value="CNM Portal" />
- <put name="bodytitle" value="Home" />
- <put name="body" value="/00-CNM_Landing.jsp" />
- </definition>
- public class YourControllerClasss implements Controller
- public void perform(ComponentContext context,
- HttpServletRequest request,
- HttpServletResponse response,
- ServletContext servletContext)
- throws ServletException, IOException {
- //some logic to determine what the 'body' should be
- if (service.isUp()){
- request.setAttribute("nameOfJSPToImport", "/jsps/import-me.jsp");
- }else{
- request.setAttribute("nameOfJSPToImport", "/jsps/import-me-instead.jsp");
- }
- }
- }
- <c:import url="${nameOfJSPToImport}" />
Add Comment
Please, Sign In to add comment