"LITT Vincent (Neuilly Gestion)" wrote:
>
> Hello,
> Does anybody know how to pass a session object created in a Jsp by :
>
>   session = request.getSession( true );
>   session.putValue ("Usr_Name", request.getParameter("user_name") );
>
> In fact I tried the same code in the servlet, but the 2 sessions objects are
> different ...
>
> Any Help is welcome

You don't give us much information to go on. The code you have obviously
puts an object in the session. If this information is not available when
you request another servlet or JSP page, it's because the new request is
not part of the same session. Some possible reasons:

1) The browser doesn't support/enables cookies and you do not call
   encodeURL() to enable URL rewriting for session tracking.
2) The servlet/JSP that creates the session and puts the object in the
   session, and the next servlet/JSP is not part of the same servlet
   context. For instance, if you make the first request with a URL
   like /servlet/foo and the second with /myapp/myjsp.jsp, they are
   probably not part of the same context (web application) since they
   don't have the same URI prefix.

Read the Servlet 2.2 and JSP 1.1 specifications for details about
web applications/servet contexts and session tracking. If that doesn't
solev your problem, include information about the URLs you use when you
post to the list again.

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to