Sun Java Solaris Communities My SDN Account Join SDN
 
FAQ

Questions and Answers - Packaging and Deployment

 
 


Guidelines, Patterns, and code for end-to-end Java applications.

Questions and Answers - Packaging and Deployment
  1. How do I map multiple URLs to point to a single page created with the JavaServer PagesTM technology (JSPTM page)?

    1.  How do I map multiple URLs to point to a single page created with the JavaServer PagesTM technology (JSPTM page)?

    The web deployment descriptor maps URLs to web components. For example, the Java Pet Store sample application maps all URLs matching /control/* to MainServlet in web.xml like this:

    <web-app>
      <display-name>WebTier</display-name>
      <description>no description</description>
    
      <servlet>
        <servlet-name>webTierEntryPoint</servlet-name>
        <display-name>centralServlet</display-name>
        <description>no description</description>
        <servlet-class>
      com.sun.j2ee.blueprints.petstore.control.web.MainServlet
        </servlet-class>
      </servlet>
    
      <servlet-mapping>
        <servlet-name>webTierEntryPoint</servlet-name>
        <url-pattern>/control/*</url-pattern>
      </servlet-mapping>
    
      <!-- web.xml continues... -->