Struts Tiles - Passing a parameter from layout template into a tile JSP?
posted 5 years ago
I am creating a web app using Tomcat v4.1, JDK v1.4.2, and Struts v1.1 (with Tiles). The format/layout of each JSP in our web app is controlled by a Tiles layout template (call it Layout.jsp). Layout.jsp in turn "inserts" or uses Header.jsp as one of it's tiles to display a common header on each page. Also contained in Header.jsp is some code for a navigation menu at the top of the header/page ("i.e like -> Main | Download | Search | Help | Contact Us").
What I want to be able to do is somehow pass a parameter into Header.jsp that indicates which page I am currently on, so that I can disable that page link, and enable all of the other page links.
So to try and simplify this: I have a content JSP called Mainmenu.jsp. I want to setup a parameter in Mainmenu.jsp, that gets passed through Layout.jsp, and into Header.jsp so that I can disable just the "Main" link, and enable the remaining page links. I have looked over tiles tags but I am not sure how to go about doing this. Or maybe there is a better way to approach this all together ? Any help/ideas would be MOST appreciated!