Metawerx Java Hosting Small Logo

<jsp-file>

This tag specifies a JSP file to be used in a <servlet> definition.

This allows servlet-mappings to map various paths to JSP files instead of to a servlet.

Example Code

In web.xml ...
<servlet>
    <servlet-name>jsptester</servlet-name>
    <jsp-file>showpath.jsp</jsp-file>
</servlet>
<servlet-mapping>
    <servlet-name>jsptester</servlet-name>
    <url-pattern>/tester/*<url-pattern>
</servlet-mapping>
JSP file showpath.jsp:
Hello, I am showpath.jsp.  The path you entered was: <%= request.getRequestURI() %>
Enter any of the following URLs in your browser:
http://yourwebsite/tester
http://yourwebsite/tester/
http://yourwebsite/tester/folder1
http://yourwebsite/tester/folder1/
http://yourwebsite/tester/folder1/test.htm
http://yourwebsite/tester/folder1/test.pdf
http://yourwebsite/tester/folder1/test.xls
The JSP file will show the path.

See Also

navigation
metawerx specific
search
Share
tools
help

referring pages
Valid XHTML 1.0 Transitional

Share