Yi-Jane Jiang wrote:

> Dear all,
>
> Could anyone tell me how jswdk1.0.1 works??
>
> I encountered a problem when I used session.
> Why should I use " action="/examples/servlet/InstallProServlet" " in a form
> instead of using " action="/servlet/InstallProServlet" " to make session
> work?
> If I use the second one, then the InstallProServlet can't get the session
> from
> this jsp page.
>
> I put my InstallProServlet in D:\Jswdk\1.0.1\webpages\WEB-INF\servlets not
> in
> D:\Jswdk\1.0.1\examples\WEB-INF\servlets.
>
> I think it's because the way a jswdk server retrieve a servlet.
> Could anyone tell me how it works??
>

One key issue is that sessions are only valid within a particular servlet
context.  In the default JSWDK setup (as well as for Tomcat), any URL that
begins "/examples" is in one servlet context, while everything else is in a
different one that handles all URLs that do *not* begin with "/examples".
Therefore, sessions will not cross the boundary between the two.

If your JSP page that is linking to this servlet is in the "/examples" tree,
this is why the session works with the first URL
(/examples/servlet/InstallProServlet) but not the second
(/servlet/InstallProServlet).

Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to