I’m trying to modify how my pages look like, based on which module is currently active. So basically, I have one common set of jsp pages, that need to have tiles changed based on the module.
I am able to implement basic tiles independently with each module. This requires me to specify in the jsp the definition of the tile. So my question is, how can I change the definiton, and hence, have the tiles change dynamically based on the module.
I’m using Tiles with Struts 1.1 (Not my choice, but the requirements were such), and am new to this framework.
Edit: I’ve tried going through the docs, browsing other forums and blogs, but havent encountered anything similar to this. Is there any other way to achieve this, probably without switching the tile definitions?
What I understood from your question is you will be having 2 definition for 1 JSP in tiles-defs.xml file. Like
One way I suggest to achieve your requirement is by setting module type in attribute (say
request.setAttribute("module", "module2");).Suppose you will be having 2 forwards for same JSP page in struts-config.xml.
Then in your JSP page(tileTest.jsp), the tiles will be defined something like