Adding and deleting JavaServer Pages to a free-form project

You can add or delete JavaServer Pages (JSP) to or from a free-form project.

Steps

  1. To add a JSP file to a free-form project, use your file management system to properly place your JSP artifacts into the free-form project. The directory name of the free-form project has the same string value you had provided for the -project parameter used in the wrd-config command.
  2. The following activities occur when you drop a JSP into the free-form project:
    1. The JSP is mapped to the Web Content folder in the Web module project. The console output can look like this example when adding a JSP source file (called MyJSP.jsp) to a free-form project (called MyProject):
      [08:15:23 PM] [/MyProject/MyJSP.jsp] Added
      
      [08:15:23 PM] [/MyProject/MyJSP.jsp] coppied to project [MyProject]
      
      [08:15:23 PM] JSP entry added to web.xml: MyJSP
      
      [08:15:23 PM] Servlet mapping added.  URL is: [MyProjectWeb/MyJSP]
      
      Tip: If you want to monitor the rapid deployment activity, run your rapid deployment session with console output. You can complete this by running the rapid deployment launch tool as follows:
      • For Windowswrd.bat -monitor
      • For UNIXwrd.sh -monitor
    2. A new servlet entry and servlet mapping entry is created in the Web deployment descriptor (found in the WebContent\WEB-INF\web.xml file in the Web module project). The following is an example of the entries in web.xml:
      <servlet>
      
      	<servlet-name>MyJSP</servlet-name>
      
      	<jsp-file>MyJSP.jsp</jsp-file>
      
      </servlet>
      
      <servlet-mapping>
      
      	<servlet-name>MyJSP</servlet-name>
      
      	<url-pattern>/MyJSP</url-pattern>
      
      </servlet-mapping>
    3. The application is synchronized with the server.
  3. You can test the JSP running on the server, use the URL displayed in the console. In this example, the console output provided the following URL mapping information to the deployed JSP:
    [08:15:23 PM] Servlet mapping added.  URL is: [MyProjectWeb/MyJSP]
    Type http://<machine_name>:<port>/MyProjectWeb/MyJSP in the address bar and press Enter. Where <machine_name> is the host machine where WebSphere® Application Server runs. By default, WebSphere Application Server runs on port 9080.
  4. To delete JSP files from a free-form project, use your file management system to properly remove your JSP artifacts from the free-form project. The directory name of the free-form project has the same string value you had provided for the -project parameter used in the wrd-config command.
  5. The following activities occur when you remove a JSP from the free-form project:
    1. The console output can look like this example when removing a JSP source file (called MyJSP.jsp) from a free-form project (called MyProject):
      [08:19:40 PM] [/MyProject/MyJSP.jsp] Deleted
      
      [08:19:40 PM] Servlet Mapping removed from web.xml /MyJSP
      
      [08:19:40 PM] JSP entry removed from web.xml MyJSP
      
    2. The application is synchronized with the server.
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.