You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Pratt <th...@gmail.com> on 2007/08/30 19:28:07 UTC

Re: How to access request & session objects in jsp using struts2 tag

OK, sorry, I thought you were talking about the action.  If you want
at the attributes you can use ${requestScope.attributename} or
${sessionScope.attributename} and if you need to get at the actual
accessors you can use ${pageContext.request.contextPath}
  (*Chris*)

On 8/30/07, Dave Newton <ne...@yahoo.com> wrote:
> --- afp <ar...@bankofamerica.com> wrote:
> > [...] but really tat doesn't quite answer the
> > question. In general how do we access the request or
>
> > session in the jsp?
>
> http://struts.apache.org/2.x/docs/ognl.html
>
> > Will what I have given below work
>
> Does it work?
>
> > or what shud I be doing to make it work!
>
> I think the dot-notation will cause you problems, but
> I could be wrong about that--you might be able to
> coerce it somehow.
>
> Or you could set a flag in the action or expose an
> object that holds the request value.
>
> > The requirement is tat I need to access it in the
> jsp
> > and not in the action class method.
>
> Really? Or is the requirement that you be able to make
> decisions in the JSP based on which submit button was
> used?
>
> d.
>
>
> ---------------------------------------------------------------------
> 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: How to access request & session objects in jsp using struts2 tag

Posted by Chris Pratt <th...@gmail.com>.
It's JSP 2.0 EL (which isn't specific to JSTL any longer) so you
should be able to use it.  Otherwise you'll have to look up the
analogs in OGNL (I don't have my reference handy).
  (*Chris*)

On 8/30/07, afp <ar...@bankofamerica.com> wrote:
>
> np chris!
>
> Is tat using JSTL? I am not using JSTL in my app. How can I get it working
> in/using struts2 tags  <s:tags /> ??
>
> Arup
>
> Chris Pratt wrote:
> >
> > OK, sorry, I thought you were talking about the action.  If you want
> > at the attributes you can use ${requestScope.attributename} or
> > ${sessionScope.attributename} and if you need to get at the actual
> > accessors you can use ${pageContext.request.contextPath}
> >   (*Chris*)
> >
> > On 8/30/07, Dave Newton <ne...@yahoo.com> wrote:
> >> --- afp <ar...@bankofamerica.com> wrote:
> >> > [...] but really tat doesn't quite answer the
> >> > question. In general how do we access the request or
> >>
> >> > session in the jsp?
> >>
> >> http://struts.apache.org/2.x/docs/ognl.html
> >>
> >> > Will what I have given below work
> >>
> >> Does it work?
> >>
> >> > or what shud I be doing to make it work!
> >>
> >> I think the dot-notation will cause you problems, but
> >> I could be wrong about that--you might be able to
> >> coerce it somehow.
> >>
> >> Or you could set a flag in the action or expose an
> >> object that holds the request value.
> >>
> >> > The requirement is tat I need to access it in the
> >> jsp
> >> > and not in the action class method.
> >>
> >> Really? Or is the requirement that you be able to make
> >> decisions in the JSP based on which submit button was
> >> used?
> >>
> >> d.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/How-to-access-request---session-objects-in-jsp-using-struts2-tags-tf4354438.html#a12412606
> 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
>
>

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


Re: How to access request & session objects in jsp using struts2 tag

Posted by afp <ar...@bankofamerica.com>.
np chris!

Is tat using JSTL? I am not using JSTL in my app. How can I get it working
in/using struts2 tags  <s:tags /> ??

Arup

Chris Pratt wrote:
> 
> OK, sorry, I thought you were talking about the action.  If you want
> at the attributes you can use ${requestScope.attributename} or
> ${sessionScope.attributename} and if you need to get at the actual
> accessors you can use ${pageContext.request.contextPath}
>   (*Chris*)
> 
> On 8/30/07, Dave Newton <ne...@yahoo.com> wrote:
>> --- afp <ar...@bankofamerica.com> wrote:
>> > [...] but really tat doesn't quite answer the
>> > question. In general how do we access the request or
>>
>> > session in the jsp?
>>
>> http://struts.apache.org/2.x/docs/ognl.html
>>
>> > Will what I have given below work
>>
>> Does it work?
>>
>> > or what shud I be doing to make it work!
>>
>> I think the dot-notation will cause you problems, but
>> I could be wrong about that--you might be able to
>> coerce it somehow.
>>
>> Or you could set a flag in the action or expose an
>> object that holds the request value.
>>
>> > The requirement is tat I need to access it in the
>> jsp
>> > and not in the action class method.
>>
>> Really? Or is the requirement that you be able to make
>> decisions in the JSP based on which submit button was
>> used?
>>
>> d.
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-access-request---session-objects-in-jsp-using-struts2-tags-tf4354438.html#a12412606
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