struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Fröhlich <>
Subject AW: How can I "parameterize" include files?
Date Thu, 18 Dec 2008 09:24:21 GMT
Hi James,

is it possible for you to use the <s:component...... > tag??
I think that is exactly what you are searching for.

As an example:
<s:component template="menuEntry.jsp" theme="foo">
	<s:param name="menuName">downtime</s:param>
	<s:param name="menuLink"></s:param>
To make this work, you have to create a folder "/template/foo" and place the menuEntry.jsp
in it.
This file could look like

<a href="%{parameters.menuLink}" ><s:text name=" %{parameters.menuName}" /></a>

Just for example....

Hope that helps!


-----Urspr√ľngliche Nachricht-----
Von: James Carr [] 
Gesendet: Mittwoch, 17. Dezember 2008 17:35
Betreff: How can I "parameterize" include files?

Hi all,

I have a common navigation bar I have at the top of a bunch of pages,
but I'd like for certain buttons to not be present on some pages. I
tried using <s:param> and <s:if> , but to no avail.

For example:

	<s:include value="includes/something.jsp" >
		<s:param name="foo" value="true"/>

and in the included file have this:
<s:if test="foo">
<!-- content -->

However this doesn't seem to work. For now I've resorted to use the
jakarta taglibs for conditional statements, but I'd rather use the
struts2 tags.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message