Hans, that worked. Thank you *very* much! For everyone else, the root problem was that I had my JSP files in the %CATALINA_HOME%/webapps/ROOT directory, instead of in my webapp directory. Since they weren't in the same application, Tomcat did not let them share information.
BTW, Hans is the author of JavaServer Pages (O'Reilly), http://TheJSPBook.com. (The supposed String literal problem had nothing to do with anything. Guys -- a string literal is automatically converted to a String, and a String *is* an Object. But thanks for trying to help, I really do appreciate that.) -- Jim At 02:50 PM 12/18/2001, you wrote: >Jim, > > > Thanks very much for responding, Hans. I tried your suggestion in my > servlet, > > but now Tomcat can't even find the JSP page! I had this problem with using > > RequestDispatcher.forward() -- I just couldn't figure out where the heck it > > was expecting the JSP to be. > > > > -- I am using Tomcat 4.0. > > -- My index.jsp (set to be the welcome page), resides in > > %CATALINA_HOME%/webapps/ROOT -- this is the Tomcat default welcome page > > location. > > -- My app is called "spads", and the specific servlet is in the package > > spads.user. So it is %CATALINA_HOME%/webapps/ > > spads/WEB-INF/classes/spads/user/UserLoginServlet.class. > >Your JSP pages and your servlets must be in the same web application, >so move all your JSP pages to the webapps/spads directory. Or, move your >servlets to the ROOT (default) application. > > > -- When I tried to use RequestDispatcher.forward(), it seemed like no > matter > > where I put it the new JSP page, it could not be located. > >Probably because you can only forward to resources (servlets, JSP pages) >within the same web application, and the path you give in >getRequestDispatcher() >must be a context-relative path (starting with a slash, interpreted relative >to the context path, i.e. "/spads" in your case). > > > -- Furthermore, UserLoginServlet couldn't even locate the old index.jsp > that I > > was going back to on login errors. > > -- So I tried sendRedirect(), and that worked, as long as the new > > userLoggedIn.jps was also in %CATALINA_HOME%/webapps/ROOT. > > -- Everything seemed to be working. That is, until I tried using > > session/application tracking... > >See the above. If you make the servlets and the JSP pages part of the same >application, things will work as expected. > >Hans >-- >Hans Bergsten [EMAIL PROTECTED] >Gefion Software http://www.gefionsoftware.com >Author of JavaServer Pages (O'Reilly), 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
