Is it possible to pass dynamic values in tiles.xml as we do in struts.xml in Struts2? I have used ${parameter} to get dynamic values in config file but it doesnt seem to work. Any ideas?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can pass wildcards to tiles from your struts actions, I’ve used this to do similar things for dynamic projects where each client might have a different CSS file for instance.
In your struts action you would have a tiles result type and you can pass the value such as:
And then in your tiles.xml you would “plug in” the wildcards:
In this particular example the struts action pageID is the project directory where the files are located and in the tiles.xml it is placed as wildcard {1}. The fileID is the filename associated with this particular action or user represented in the tiles.xml by {2}. You can use this set up to pass dynamic values to your tiles in order to control for example page states or JSP’s to render or like in this example, custom css and js files.