You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tim Azzopardi <ti...@tigerfive.com> on 2006/12/22 16:27:17 UTC

struts2 how to access a param s:include

If I have,

<s:include value="fleetSelect.jsp">
	<s:param name="param1" value="value2" />
</s:include>

How do I access param1 in fleetSelect.jsp?

I've tried a load of combinations and can't get anything to work.

(Sorry for the dumbass question , i've read and reread the docs - i think
I'm going snowblind)

struts-2.0.1
-- 
View this message in context: http://www.nabble.com/struts2-how-to-access-a-param-s%3Ainclude-tf2871075.html#a8024718
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: struts2 how to access a param s:include

Posted by Tim Azzopardi <ti...@tigerfive.com>.

Tim Azzopardi wrote:
> 
> If I have,
> 
> <s:include value="fleetSelect.jsp">
> 	<s:param name="param1" value="value2" />
> </s:include>
> 
> How do I access param1 in fleetSelect.jsp?
> 
> I've tried a load of combinations and can't get anything to work.
> 
> (Sorry for the dumbass question , i've read and reread the docs - i think
> I'm going snowblind)
> 
> struts-2.0.1
> 

Doh! in value="value2" above the value2 is evaluated as an ONGL expression -
its not a literal string.

If you say
<s:include value="fleetSelect.jsp">
	<s:param name="param1" value="%{'value2'}"/>
</s:include>

or more simply

<s:include value="fleetSelect.jsp">
	<s:param name="param1">value2</s:param>
</s:include>


then you can access the param in a jsp with:
    ${param.param1}
or
    <%= "param1:" + request.getParameter("param1") %>


(Exactly the same thing applies to the action tag too.)
-- 
View this message in context: http://www.nabble.com/struts2-how-to-access-a-param-s%3Ainclude-tf2871075.html#a8027572
Sent from the Struts - User mailing list archive at Nabble.com.


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