Soefara Redzuan wrote:
>
> > > 1. It produces some really horrible URLS. For example ~
> > >    http://www.yyy.com/index.jsp?level1=Products&level2=Goo&level3=...;
>
> >  Map the entire 'products' tree to a single servlet,
>
> .. it didn't work. ... using one of the 'snoop' example JSP
> that comes with Tomcat, the following creates a 'Page not
> found' error
>

 The snoop jsp uses the default suffix mapping, but the
snoop servlet is explicitly mapped. SRV.11.2 "Specification
of Mappings" from version 2.3 of the servlet spec[1] has
details about how it all works. Add the following to
examples/WEB-INF/web.xml:

   <servlet>
      <servlet-name>snoopjsp</servlet-name>
      <jsp-file>/jsp/snp/snoop.jsp</jsp-file>
    </servlet>

     ...

    <servlet-mapping>
      <servlet-name>snoopjsp</servlet-name>
      <url-pattern>/products/*</url-pattern>
    </servlet-mapping>

 Then:

   http://duck:8080/examples/products/foo/bar/baz

 produces:

   Request Information
   ...
   Path info: /foo/bar/baz
   ...


[1] You can download the spec from:
    http://java.sun.com/products/servlet/download.html
    The spec is very easy to read.

--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.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

Reply via email to