struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Becky.L.O'Sulli...@mhn.com
Subject Re: couldn't access s:include param using #parameters
Date Wed, 27 Aug 2008 16:48:29 GMT
Unfortunately you can't use JSTL in Struts 2 tags anymore.  I got around
this by using JSTL to set the parameter into page scope:

<c:set var="paramName" value="${param.paramName}"/>

Once it's in page scope #attr will find it:

<s:if test="#attr.paramName == 'someStringValue'">found it!</s:if>

-B



                                                                           
             "Musachy Barroso"                                             
             <musachy@gmail.co                                             
             m>                                                         To 
                                       "Struts Users Mailing List"         
             08/26/2008 06:57          <user@struts.apache.org>            
             PM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: couldn't access s:include param 
               "Struts Users           using #parameters                   
               Mailing List"                                               
             <user@struts.apac                                             
                  he.org>                                                  
                                                                           
                                                                           
                                                                           




Parameters are passed as request parameters, so use the
${param.ParamName} notation to access them.

musachy

On Tue, Aug 26, 2008 at 9:51 PM, Martin Gainty <mgainty@hotmail.com> wrote:
>
> in your struts-default.xml or xwork-default.xml
> can you verify you have implemented ParametersInterceptor
> <interceptor name="params"
class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>
>  in your <default> stack
>
> ?
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission.
>
>
>> Date: Tue, 26 Aug 2008 18:10:14 -0700
>> From: pandamouse@hotmail.com
>> To: user@struts.apache.org
>> Subject: couldn't access s:include param using #parameters
>>
>>
>> Okay I have made 2 small jsp. I can't access parameters passed in from
>> s:include (struts 2.0.11.2) by #parameters.<parametername> OR
>> #parameters['<parametername>']. Am I doing something really wrong?
>>
>> quicktest.jsp:
>> <%@ taglib prefix="s" uri="/struts-tags" %>
>>
>> <s:include value="quicktestincluded.jsp">
>>      <s:param name="defaultValue">0</s:param>
>> </s:include>
>>
>> quicktestincluded.jsp:
>> <%@ taglib prefix="s" uri="/struts-tags" %>
>>
>> parameter with $ { } : ${param.defaultValue} <br>
>> parameter with s:property: <s:property
value="#parameters.defaultValue"/>
>>
>> Now if I access quicktest.do. It give me the following:
>> parameter with $ { } : 0
>> parameter with s:property:
>>
>> And if I access quicktestincluded.do like this
>> 'quicktestincluded.do?defaultValue=0' it would give me:
>> parameter with $ { } : 0
>> parameter with s:property: 0
>>
>> --
>> View this message in context:
http://www.nabble.com/couldn%27t-access-s%3Ainclude-param-using--parameters-tp19173169p19173169.html

>> 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
>>
>
> _________________________________________________________________
> Be the filmmaker you always wanted to beā€”learn how to burn a DVD with
Windows(R).
> http://clk.atdmt.com/MRT/go/108588797/direct/01/



--
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

---------------------------------------------------------------------
Mime
View raw message