1 / 4

Pure Struts web-application

Pure Struts web-application. layout.jsp. header.jsp. menu.jsp. body. classical include in servlet response. footer.jsp. mybody.jsp. tiles-def.xml. <definition name=" myPage " extends=" t emplate"> <put name=" body " value="/my body .jsp" /> </definition>. <html:form> …

aimon
Download Presentation

Pure Struts web-application

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pure Struts web-application layout.jsp header.jsp menu.jsp body classical include in servlet response footer.jsp mybody.jsp tiles-def.xml <definition name="myPage" extends="template"> <put name="body" value="/mybody.jsp" /> </definition> <html:form> … </html:form> + struts-config.xml <action path="/showMyPage" ...> <forward name="success" path="myPage"/> </action>

  2. Pure Struts web-application • When an action forwards to a Tiles page • The top-level template (layout.jsp) is played and runs the include of the different sections (header, body,..) • Consequences • There is no jsp that is capable of totally displaying the "final" web page - only the (Tiles)RequestProcessor is able to do it • Calling "layout.jsp" will fail • Calling "body.jsp" will partially succeed

  3. Struts-faces web-application layout.jsp header.jsp menu.jsp body <bean:write name="body"  filter="false" /> footer.jsp tiles-def.xml myJsfPage.jsp <definition name="myPage" extends="template"> </definition> <tiles:insert name="myPage"> <tiles:put name="body" type="string"> </tiles:put> </tiles:insert> + <f:use_faces> <s:form> … </s:form> </f:use_faces> struts-config.xml <action path="/showMyPage" ...> <forward name="success" path="/faces/myJsfPage.jsp"/> </action>

  4. Struts-faces web-application • Action-forwards refer to physical jsp page • Exactly like a non-Tiles Struts application • No more possible to foward to a logical Tiles page • Consequences • Every jsp should • first insert the desired layout (i.e. the Tiles definition) • then enclose the variable parts (such as its body) as parameters of the specified layout insertion • The jsp’s are now capable of totally rendering the "final" web page • Calling "myJsfPage.jsp" (as JSF is used to do) will succeed

More Related