CONTENTS | PREV | NEXT | INDEXJ2EE BluePrints



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... -->
    


    CONTENTS | PREV | NEXT | INDEX
    Copyright © 2001 Sun Microsystems, Inc. All Rights Reserved.