div.collapsecontent{display:block;}

Express (Distributed operating systems), v8.0 > Develop and deploying applications > Rapid deployment of J2EE applications > Constructing a J2EE application from artifacts > Dropping J2EE artifacts into a free-form project > Add and deleting Web artifacts from a free-form project


Add and deleting JSP to a free-form project

We can add or delete JSP to or from a free-form project.


About this task

Restriction: We can use the rapid deployment tools for packaging applications at J2EE 1.3 or 1.4 specification-levels. However, the rapid deployment tools do not support Java EE 5.0 (or later) nor J2EE 1.2 specification-level. For tools support of deploying Java EE 5 and later modules, you can use the monitored directory starting in WAS V8.0 release. For more details about the monitored directory, see Ways to install enterprise applications or modules and Installing enterprise application files by adding them to a monitored directory topics.


Procedure

  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: To monitor the rapid deployment activity, run your rapid deployment session with console output. We can complete this by running the rapid deployment launch tool as follows:

      • wrd.bat -monitor
      • wrd.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). 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. We 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 //publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/ :// <machine_name>: <port>/MyProjectWeb/MyJSP in the address bar and press Enter. Where <machine_name> is the host machine where WAS runs. By default, WAS 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

+

Search Tips   |   Advanced Search