I noticed some posts about people having problems loosing the session
information when using JSPs with servlets.  For examples if I did the 
following in a JSP:

  <FORM ACTION="/servlet/com.mycom.MyServlet" ... >

when MyServlet got control, the Session was empty.

I found out that if I did this the "right way" and defined the servlet in
my web.xml, e.g.,

      <servlet>
         <servlet-name>theServlet</servlet-name>
         <servlet-class>com.mycom.MyServlet</servlet-class>
       </servlet>
       <servlet-mapping>
          <servlet-name>theServlet</servlet-name>
          <url-pattern>someServlet</url-pattern>
       </servlet-mapping>

and in the JSP said:

  <FORM ACTION="someServlet" ... >

then all worked fine.

You may have to adjust the path a bit depending upon where your
JSP is, etc.  The Tomcat mapping trace can help you debug
mapping problems.

This seems like it is a Tomcat bug, but the above is not only a
workaround, but a more maintainable way of doing things.

Frank Lawlor
Athens Group, Inc.
(512) 345-0600 x151
Athens Group, an employee-owned consulting firm integrating technology
strategy and software solutions.



Reply via email to