You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ashish Jain <aj...@gmail.com> on 2008/01/27 14:33:30 UTC

example?

I am new to struts2
I am struggling to include jsp in a jsp.
I am passing an param to included jsp and I want to access that param
in included jsp.

I tried different combinations.. none is seem to be working.

Only thing, working is <%= request.getParameter("configKey")%>
But how to use this param in struts tags?


here is my code
in main jsp
========
<s:include value="inc/settingsRow.jsp">
  <s:param name="configKey" value="%{'domainName'}"/>
</s:include>


included jsp
=========
<%@ include file="/tagDefinitions.jsp" %>
<s:set name="configKey1" value="#request.configKey"></s:set>
 <tr>
 <td><s:text name="label.%{configKey1}"/></td>
</tr>


-- 
Thanks
Ashish

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


Re: example?

Posted by bhaarat Sharma <bh...@gmail.com>.
> Only thing, working is <%= request.getParameter(\"configKey\")%>

you can tru OGNL
#parameters[\'configKey\']


On 1/27/08, Ashish Jain <aj...@gmail.com> wrote:
I am new to struts2
> I am struggling to include jsp in a jsp.
> I am passing an param to included jsp and I want to access that param
> in included jsp.
>
> I tried different combinations.. none is seem to be working.
>
> Only thing, working is <%= request.getParameter(\"configKey\")%>
> But how to use this param in struts tags?
>
>
> here is my code
> in main jsp
> ========
> <s:include value=\"inc/settingsRow.jsp\">
>   <s:param name=\"configKey\" value=\"%{\'domainName\'}\"/>
> </s:include>
>
>
> included jsp
> =========
> <%@ include file=\"/tagDefinitions.jsp\" %>
> <s:set name=\"configKey1\" value=\"#request.configKey\"></s:set>
>  <tr>
>  <td><s:text name=\"label.%{configKey1}\"/></td>
> </tr>
>
>
> --
> Thanks
> Ashish
>
> ---------------------------------------------------------------------
> 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


Re: example?

Posted by Enrico Drusiani <ed...@zensistemi.com>.
Hi All

i'm new to struts2 so sorry for the silly question but i just don't 
understand how could you retrieve a parameter passed with <s:param> to 
the included page, then. meanwhile i still use the old jsp solution, but 
i'd prefer to learn how to do it the correct struts way

thanks for any hint on that topic.

Enrico

Ashish Jain ha scritto:
> So, can we access supplied params somehow?
> (I can't use <%= request.getParameters(...))%> inside <s:tags../>
>
>
> If no, then why it accepts params? wht for?
>
> Secondly,
> i can use <jsp:include/> with params.
> but again, it's visible as request.getParameter.. but not on valuestack.
>
>
>
> On Jan 27, 2008 11:45 AM, Dave Newton <ne...@yahoo.com> wrote:
>   
>> http://struts.apache.org/2.x/docs/include.html
>>
>> Note, specifically, the part that says "Note: Any additional params supplied
>> to the included page are not accessible within the rendered page through the
>> <s:property...> tag!"
>>
>> d.
>>
>>
>> --- Ashish Jain <aj...@gmail.com> wrote:
>>
>>     
>>> I am new to struts2
>>> I am struggling to include jsp in a jsp.
>>> I am passing an param to included jsp and I want to access that param
>>> in included jsp.
>>>
>>> I tried different combinations.. none is seem to be working.
>>>
>>> Only thing, working is <%= request.getParameter("configKey")%>
>>> But how to use this param in struts tags?
>>>
>>>
>>> here is my code
>>> in main jsp
>>> ========
>>> <s:include value="inc/settingsRow.jsp">
>>>   <s:param name="configKey" value="%{'domainName'}"/>
>>> </s:include>
>>>
>>>
>>> included jsp
>>> =========
>>> <%@ include file="/tagDefinitions.jsp" %>
>>> <s:set name="configKey1" value="#request.configKey"></s:set>
>>>  <tr>
>>>  <td><s:text name="label.%{configKey1}"/></td>
>>> </tr>
>>>
>>>
>>> --
>>> Thanks
>>> Ashish
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>>     
>
>
>
>   



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


Re: example?

Posted by Ashish Jain <aj...@gmail.com>.
So, can we access supplied params somehow?
(I can't use <%= request.getParameters(...))%> inside <s:tags../>


If no, then why it accepts params? wht for?

Secondly,
i can use <jsp:include/> with params.
but again, it's visible as request.getParameter.. but not on valuestack.



On Jan 27, 2008 11:45 AM, Dave Newton <ne...@yahoo.com> wrote:
> http://struts.apache.org/2.x/docs/include.html
>
> Note, specifically, the part that says "Note: Any additional params supplied
> to the included page are not accessible within the rendered page through the
> <s:property...> tag!"
>
> d.
>
>
> --- Ashish Jain <aj...@gmail.com> wrote:
>
> > I am new to struts2
> > I am struggling to include jsp in a jsp.
> > I am passing an param to included jsp and I want to access that param
> > in included jsp.
> >
> > I tried different combinations.. none is seem to be working.
> >
> > Only thing, working is <%= request.getParameter("configKey")%>
> > But how to use this param in struts tags?
> >
> >
> > here is my code
> > in main jsp
> > ========
> > <s:include value="inc/settingsRow.jsp">
> >   <s:param name="configKey" value="%{'domainName'}"/>
> > </s:include>
> >
> >
> > included jsp
> > =========
> > <%@ include file="/tagDefinitions.jsp" %>
> > <s:set name="configKey1" value="#request.configKey"></s:set>
> >  <tr>
> >  <td><s:text name="label.%{configKey1}"/></td>
> > </tr>
> >
> >
> > --
> > Thanks
> > Ashish
> >
> > ---------------------------------------------------------------------
> > 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
>
>



-- 
Thanks
Ashish Jain
IntelliConcepts, Inc.
+1 (732) 259 9855 (voice)
+1 (609) 632 0081 (home, fax)

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


Re: example?

Posted by Dave Newton <ne...@yahoo.com>.
http://struts.apache.org/2.x/docs/include.html

Note, specifically, the part that says "Note: Any additional params supplied
to the included page are not accessible within the rendered page through the
<s:property...> tag!"

d.

--- Ashish Jain <aj...@gmail.com> wrote:

> I am new to struts2
> I am struggling to include jsp in a jsp.
> I am passing an param to included jsp and I want to access that param
> in included jsp.
> 
> I tried different combinations.. none is seem to be working.
> 
> Only thing, working is <%= request.getParameter("configKey")%>
> But how to use this param in struts tags?
> 
> 
> here is my code
> in main jsp
> ========
> <s:include value="inc/settingsRow.jsp">
>   <s:param name="configKey" value="%{'domainName'}"/>
> </s:include>
> 
> 
> included jsp
> =========
> <%@ include file="/tagDefinitions.jsp" %>
> <s:set name="configKey1" value="#request.configKey"></s:set>
>  <tr>
>  <td><s:text name="label.%{configKey1}"/></td>
> </tr>
> 
> 
> -- 
> Thanks
> Ashish
> 
> ---------------------------------------------------------------------
> 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