Try put <%@ page session="true" %> on top of your results.jsp.

Sanjeev Kumar Sharma wrote:

> Hi!
> Use session 's putValue("key","value);
> then in JSP call getValue("key");
> It will definetly work
> bye
>
> At 09:19 AM 8/24/00 -0600, you wrote:
> >I have a servlet that accepts values from a jsp and processes them, then
> >passes them back to another jsp through the session object. However, the jsp
> >that receives the values from the servlet displays those values as "null".
> >Now, if I have the servlet generate the output, the values display as
> >expected. Here's the code in  the servlet:
> >
> >HttpSession session = req.getSession(true);
> >...code that processes values...
> >session.setAttribute("id", id_response);
> >resp.sendRedirect("http://localhost/results.jsp");
> >
> >
> >Here's the code in results.jsp that doesn't seem to work:
> >
> ><html><head><title></title></head>
> ><body>
> ><%
> >        String v_id = (String) session.getAttribute("id");
> >%>
> >Here is the value <%= v_id %>
> ></body></html>
> >
> >Now, as I explained, if I comment out the redirect statement and add this
> >code to the servlet (assuming, of course, I get the PrintWriter and so
> >forth), the values display as expected:
> >
> >session.setAttribute("id", id_response);
> >out.println("Here is the value " + session.getAttribute("id"));
> >out.flush();
> >
> >Can anyone help me understand this behaviour?
> >
> >Thanks in advance,
> >[EMAIL PROTECTED]
> >
> >===========================================================================
> >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
> >
> >
> Sanjeev Kumar Sharma
> Velocient Technologies Ltd.
> F-2/B-1, Mohan Co-operative Industrial Estate,
> New Delhi-110044.
> Off:-  # 91-6945226/7/8-120
> Res:-   # 91-4518858
>
> ===========================================================================
> 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

--
Java Programmer |INVISIBLE.INK | http://www.inink.com
1400 Old Country Road Suite 408 | Westbury, NY 11590
Phone: (516) 338 - 5283  Ext.148 | Fax: (516) 876 - 8032

===========================================================================
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