You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tony Smith <qu...@yahoo.com> on 2005/06/08 06:43:30 UTC

access session object

Hi:

In my Action class, I stored a object in session with 

 HttpSession session = request.getSession();
 session.setAttribute("myobject", object);

How can I access this object from jsp?

Thanks,



		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 


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


RE: access session object

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
According to their front page, tomcat 5.5.9 supporst the 2.4 servlet spec
and the 2.0 JSP spec.

http://jakarta.apache.org/tomcat/

See the little chart halfway down the first page.

-David

-----Original Message-----
From: Tony Smith [mailto:quickcur@yahoo.com]
Sent: Wednesday, June 08, 2005 1:03 PM
To: Struts Users Mailing List; atta-ur rehman
Subject: Re: access session object


Thanks you the post.

I need to access fields in the object stored in
sessioin. I was thinking about using the <bean:page>.

Any way, does tomcat 5.0 supports 2.4 servlet specs?



--- atta-ur rehman <at...@gmail.com> wrote:

> if you're running servlet container that supports
> 2.4 servlet specs
> and you web app is also configured to be of version
> 2.4, thru <webapp>
> element in your xml:
>
> ${myobject}
>
> in your JSP should print it. in scriptlets:
>
> <%=session.getAttribute("myobject")%>
>
> should work.
>
> "session" is reference to current session is
> available for all the JSPs.
>
>
> HTH.
>
> ATTA
> P.S By the way, and no offence please, this isn't a
> Struts question as
> much as a JSP question.
>
> On 6/7/05, Tony Smith <qu...@yahoo.com> wrote:
> > Hi:
> >
> > In my Action class, I stored a object in session
> with
> >
> >  HttpSession session = request.getSession();
> >  session.setAttribute("myobject", object);
> >
> > How can I access this object from jsp?
> >
> > Thanks,
> >
> >
> >
> >
> > __________________________________
> > Yahoo! Mail
> > Stay connected, organized, and protected. Take the
> tour:
> > http://tour.mail.yahoo.com/mailtour.html
> >
> >
> >
>
---------------------------------------------------------------------
> > 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
>
>




__________________________________
Discover Yahoo!
Find restaurants, movies, travel and more fun for the weekend. Check it out!
http://discover.yahoo.com/weekend.html


---------------------------------------------------------------------
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: access session object

Posted by Tony Smith <qu...@yahoo.com>.
Thanks you the post. 

I need to access fields in the object stored in
sessioin. I was thinking about using the <bean:page>. 

Any way, does tomcat 5.0 supports 2.4 servlet specs?



--- atta-ur rehman <at...@gmail.com> wrote:

> if you're running servlet container that supports
> 2.4 servlet specs
> and you web app is also configured to be of version
> 2.4, thru <webapp>
> element in your xml:
> 
> ${myobject}
> 
> in your JSP should print it. in scriptlets:
> 
> <%=session.getAttribute("myobject")%>
> 
> should work.
> 
> "session" is reference to current session is
> available for all the JSPs.
> 
> 
> HTH.
> 
> ATTA
> P.S By the way, and no offence please, this isn't a
> Struts question as
> much as a JSP question.
> 
> On 6/7/05, Tony Smith <qu...@yahoo.com> wrote:
> > Hi:
> > 
> > In my Action class, I stored a object in session
> with
> > 
> >  HttpSession session = request.getSession();
> >  session.setAttribute("myobject", object);
> > 
> > How can I access this object from jsp?
> > 
> > Thanks,
> > 
> > 
> > 
> > 
> > __________________________________
> > Yahoo! Mail
> > Stay connected, organized, and protected. Take the
> tour:
> > http://tour.mail.yahoo.com/mailtour.html
> > 
> > 
> >
>
---------------------------------------------------------------------
> > 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
> 
> 



		
__________________________________ 
Discover Yahoo! 
Find restaurants, movies, travel and more fun for the weekend. Check it out! 
http://discover.yahoo.com/weekend.html 


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


Re: access session object

Posted by atta-ur rehman <at...@gmail.com>.
if you're running servlet container that supports 2.4 servlet specs
and you web app is also configured to be of version 2.4, thru <webapp>
element in your xml:

${myobject}

in your JSP should print it. in scriptlets:

<%=session.getAttribute("myobject")%>

should work.

"session" is reference to current session is available for all the JSPs.


HTH.

ATTA
P.S By the way, and no offence please, this isn't a Struts question as
much as a JSP question.

On 6/7/05, Tony Smith <qu...@yahoo.com> wrote:
> Hi:
> 
> In my Action class, I stored a object in session with
> 
>  HttpSession session = request.getSession();
>  session.setAttribute("myobject", object);
> 
> How can I access this object from jsp?
> 
> Thanks,
> 
> 
> 
> 
> __________________________________
> Yahoo! Mail
> Stay connected, organized, and protected. Take the tour:
> http://tour.mail.yahoo.com/mailtour.html
> 
> 
> ---------------------------------------------------------------------
> 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


link to a layout page

Posted by Tony Smith <qu...@yahoo.com>.
I used tiles defined one of my jsp page with as the
following layout

    <definition name="studyNewLayout"
extends="mainLayout">
        <put name="title"  value="New Studys" />
        <put name="body"   value="/pages/studynew.jsp"
/>
        <put name="menu"  
value="/pages/commonstudysmenu.jsp" />
    </definition>

At another jsp page, I would like to have a link
pointed to this definition. How can I do it? I am
currently using:

<html:link
href="studyNewLayout">ToStudyNew</html:link>. But it
does not seems to work.

Thanks,



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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