Thank you, Mr. Bergsten, for your reply. I solved the issue. However, just for the record, my URL and the context of the web app were all correct. eliza
-----Original Message----- From: A mailing list about Java Server Pages specification and reference [mailto:[EMAIL PROTECTED]]On Behalf Of Hans Bergsten Sent: Monday, February 11, 2002 3:39 PM To: [EMAIL PROTECTED] Subject: Re: [JSP-INTEREST] forwarding a bean to a JSP from a Servlet Eliza Doolittle wrote: > Hello all, > Any help with this question would be much appreciated. I have created a mini-application that takes a parameter from a JSP and sends it through the form action to a servlet. the servlet uses the param from the request obj to retrieve info from the db based on this param. > the info from the db is then encapsulated in a very simple little bean with only two properties. I add the bean to the session and then sendRedirect to a new JSP. this second JSP is not seeing the bean within the scope specified no matter what scope I do specify. HELP!! > what are the various methods that can be used to forward a bean to a jsp from a servlet. At least 90% of the times this problem is discussed, it turns out that the servlet and the JSP page are not part of the same web applications. What this means is that the servlet is invoked with a URL like "/servlet/myServlet" and the JSP with a URL like "/myapp/myPage.jsp". Assuming that "/myapp" is the context prefix for the web application, the servlet URL must start with the same prefix: "/myapp/servlet/myServlet". Besided fixing this, you may also want to look at placing the bean in the request scope and forward to the JSP page instead of redirect to it. That's a bit more efficient. For more on web apps, context paths, forward vs. redirect, etc., I suggest searching one of the many JSP sources available online, such as the archive for this mailing list, or a good JSP book. A good place to start is: <http://java.sun.com/products/jsp/> Hans -- Hans Bergsten [EMAIL PROTECTED] Gefion Software http://www.gefionsoftware.com JavaServer Pages http://TheJSPBook.com ====================================================================== ===== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
