On Sun, 26 Aug 2001, Frot wrote:

> Date: Sun, 26 Aug 2001 15:21:38 +0200
> From: Frot <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED], [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: web.XML - JSP mapping ?
>
> Hi,
>
> Also a bit off subject, but I need some mapping for JSP pages.
>
> I get the thing working for servlets fine, using <servlet> & <servlet-mapping>.
> I dont seems to get it working for a JSP page.
>
> Could someone be so kind to define the web.xml stuff for following small setup :
>
>       jsp page to be mapped :         /subdir/jsppage.jsp
>       logical name for page :         do-jsppage
>
> My code should do something like :
>
>       dorRedirect("do-jsppage") ;
>
> Thanx,
> Fred
>
>
>

Every JSP page has an *implicit* mapping that matches it's name
("/subdir/jsppage.jsp" in the case above).  If you want to give this page
a different mapping, you can do so like this:

  <servlet>
    <servlet-name>Remapped JSP Page</servlet-name>
    <jsp-file>/subdir/jsppage.jsp</jsp-file>
  </servlet>

  ...

  <servlet-mapping>
    <servlet-name>Remapped JSP Page</servlet-name>
    <url-pattern>/do-jsppage</url-pattern>
  </servlet-mapping>

and now a URL like this:

  http://www.mycompany.com/myapp/do-jsppage

will execute the requested page.

Craig


Reply via email to