struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Fröhlich <Jan.Froehl...@infomotion.de>
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">http://www.mylink.org</s:param>
</s:component>
		
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!

Regards 
Jan


-----Urspr√ľngliche Nachricht-----
Von: James Carr [mailto:james.r.carr@gmail.com] 
Gesendet: Mittwoch, 17. Dezember 2008 17:35
An: struts-user@apache.org
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"/>
	</s:include>

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

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.

Thanks,
James

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message