Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

struts tiles: would you recommend it ?

Status
Not open for further replies.

solmyr72

Programmer
Aug 8, 2004
20
IL
Hi,

Would anyone care to share their view on struts tiles ?
In particular, we have an application where most pages follow a standard template (header, footer, navigation bar, etc).
My dilemma is basically between:

1) Using < tiles-definitions > , so that struts would automatically assign templates to pages.
The main downside of this solution appears to be that all requests *must* go through struts; even simple links to static info(currently, my company's standard is: if a link triggers some business logic - such as searching the database - then it naturally goes through a struts action . But if it's a simple navigational link leading to static info, such as the company's profile, then we use a simple < a href = "/myPage.html" > . Otherwise, the struts-config file becomes a monster ).

2) Using struts tiles without < tiles-definitions >.
Each page would declare an < insert > to associate itself with the required template, something like
Code:
// myPage.jsp
<tiles:insert page="/myLayout.jsp" flush="true">
    <tiles:put name="header" value="/header.jsp"/>
    <tiles:put name="mainwindow" value="/myPageBody.jsp"/>
    <tiles:put name="footer" value="/footer.jsp"/>    
</tiles:insert>
The main downside: extra pages to maintain (in this example, one needs both the high-level "myPage.jsp" and the internal "myPageBody.jsp").

3) Giving up on struts tiles, and using style sheets (css) with < div > tags to define the page layout, and appropriate < jsp:include > when necessary. Less powerful than struts tiles, but a valid option.

Which method would you prefer ?

Thanks very mcuh :)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top