Greetings,

I was wondering what is the difference between these two ways of
handling attributes:


1)[req is the HttpServletRequest parameter of the service() method in
HttpServlet]

...
HttpSession session=req.getSession(true);
MyObject myObject=(MyObject)session.getAttribute("xxx");
...

or

2) [using the getContext() of HttpServlet object]

...
MyObject myObject=(MyObject)getContext().getAttribute("xxx");
...


If they do the same thing, what is the preferable / recommendable way?

thanks,

Pedro Salazar

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to