Question

We have a system which uses multiple decorators for different sized pages, whilst using the same content pages. I'm trying to set a variable which can be passed to the content pages (which are written in JSP). e.g.

<c:set var="pagetype" value="mobile/" />

This method does not work because the content pages are sent to the decorator and thus need to be generated first. Is there a way to pass a variable into the pages before they are compiled, so that for instance I can use responsive images in different folders with different decorators (e.g.

<img src="uploads/${pagetype}/img.jpg />
Was it helpful?

Solution

Solution is to add it to the request scope:

<c:set var="pagetype" value="mobile/" scope="request" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top