Hi!
On 12-01-23 07:26 AM, MiB wrote:
An additional question related to the previous:
I have my
***header.jspx:***
<div id="header" xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:spring="http://www.springframework.org/tags" version="2.0">
<!--jsp output and directive -->
<h1>Main Headline</h1>
<ul id="navigation">
<!--3. I'D LIKE TO CHANGE THE CLASS FOR SOME LIST ITEMS BELOW BASED ON
THE CURRENT VIEW -->
<li id="start" class"current"><a href="/">Start</a></li>
<!-- More list items without class attribute -->
</ul>
</div>
***
On 3 above I'd like to change the class attribute on list items based on
the current view. I suppose it's a similar solution like for the
previous I need here, and also in this case what I need to affect is
inside a tile and as with the previous 1 I'd like to avoid making one
big tile per view.
The critical piece of information I'm missing is: what is the "current
view"? i.e. how are you calling Tiles? Do you get the "current view"
concept from your own request attribute, or are you using something like
spring's UrlBasedViewResolver?
Once you know that, there are easy ways of putting the data into a tiles
attribute, and then you can use that attribute in your JSP with
<tiles:insertAttribute> or <tiles:importAttribute> as you like.
Nick