I want to be able to access tiles attributes within a template via the
<s:if> construction.

The landing page has some code that looks like

<tiles:insertTemplate template="/tiles/test.jsp">
  <tiles:putAttribute name="title" type="string" value="Hello PLUGH" />
  <tiles:putAttribute name="url" type="string" value="/Struts2/who.action"
/>
  <tiles:putAttribute name="txt" type="string" value="Who are you?" />
</tiles:insertTemplate>

The pseudo code is something like:
if currentURL == url then
  <a class="active" href="url">txt</a>
else
  <a class="inactive" href="url">txt</a>
endif

I can import the tile attribute into the scope of the JSP with
<tiles:importAttribute />

and access it as "${url}" and ${txt} BUT

<s:if test="${currentURL}==${url}"> fails because the TLD does not accept
an "expression"

What I need to be able to do is to have something like:
<s:if test="#currentURL==#url"> or test="currentURL==url" or ANYTHING that
allows the ognl to access
the data.

Thank you,
-Chris

Reply via email to