Adding a Servlet to a Web Application

JavaServer Faces (JSF) implementations must provide request processing life cycle services using a servlet as defined by the Sun JavaServer Faces Specification. The Web application deployment descriptor must specify the request path mappings for the application's servlets and JSPs.

You can map full paths, partial paths, or file extensions to servlets. Path mappings are specified relative to the application's root request path.

  1. In the WorkSpace Navigator of the Web Application Development perspective, select web.xml.
  2. Select the Servlet tab of the web.xml editor.
  3. Click Add. A new servlet is added with the default name "New Servlet x."
  4. (Optional) Change the default Servlet name to a unique, descriptive name in the Servlet name field of the General Information section.
  5. Do one of the following:
    Option Action
    Select a servlet class
    1. Click Browse adjacent to the Servlet Class field.

    2. Select a type and click OK.

    Select a JSP file
    1. Click Browse adjacent to the JSP File field.

    2. Select a .jsp file and click OK.

  6. In the Servlet Mappings section, click Add.
  7. Type the URL that you want to use and click OK.
  8. In the Initialization Parameters section, click Add.
  9. Type a name and value for the parameter and click OK.
  10. In the Security Role References section, click Add.
  11. Enter a reference name in the Role Reference Name field.
  12. Select a role link.
  13. (Optional) Enter a description for the role line.
  14. In the Run As section, click Select.
  15. Select the security role that you want to use and click OK.
  16. (Optional) Click Browse in the Icons section. You can browse for and select either a small or large icon.
Related concepts
Configuring the web.xml File
Related tasks
Adding a Filter to a Web Application
Adding a Resource Reference to a Web Application
Adding an EJB Reference to a Web Application
Adding a Context Parameter to a Web Application
Adding a Listener to a Web Application
Adding a Tag Library to a Web Application
Adding a Welcome File to a Web Application
Adding an Error Page to a Web Application
Adding MIME Mapping to a Web Application
Adding an EJB Local Reference to a Web Application
Adding a Resource Environment Reference to a Web Application
Adding an Environment Entry to a Web Application
Adding Security to a Web Application
Defining the Login Configuration of a Web Application

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.