Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

[s2] s:component and reading parameters

Matt Raible

2007-08-06

Replies:


I'm trying to use the <s:component> tag to create a re-usable set of fields
in a form. In my JSP:

<s:component template="addposition.jsp">
  <s:param name="name" value="foo"/>
</s:component>

In template/simple/addposition.jsp, I have:

<%@(protected)" %>

Name: <s:property value="%{parameters.name}"/>

For some reason, this doesn't work.

Is there something I'm doing wrong? Can templates be JSPs or do they have to
be FreeMarker/Velocity?

Correct me if I'm wrong, but doesn't Struts' <s:component> tag accomplish
the same thing that can be accomplished with JSTL's <c:import> and <c:param>
tags? If so, it seems that JSP 2.0 tag files are a much more elegant
solution than <s:component> or <c:import>.

Thanks,

Matt
--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.