Create Web applications

 

Overview

In the Assembly Toolkit, you create and maintain resources for Web applications in Web projects. There are two types of Web projects, dynamic and static. Dynamic web projects can contain dynamic J2EE resources such as servlets, JavaServer Pages (JSP) files, filters, and associated metadata, in addition to static resources such as images and HTML files. Static Web projects only contain static resources.

Dynamic Web projects are always imbedded in enterprise application projects. Creating a Web project in the Assembly Toolkit requires that an enterprise application (EAR) project exist, or the Assembly Toolkit creates one for you. Creating a Web project updates the application.xml deployment descriptor of the specified enterprise application project to define the Web project as a module element. If you are importing a WAR file rather than creating a Web project new, the WAR Import wizard requires that you specify a Web project, which already requires an EAR project.

This article describes how to create a dynamic Web project using the Assembly Toolkit. For instructions on how to create a static Web project, see the Assembly Toolkit online help. In the Assembly Toolkit, click Help > Help Contents > Assembly Toolkit information > Web development > Tasks > Working with Web projects > Creating new static Web projects.

  1. Start the Assembly Toolkit.

  2. (Optional)   View an animation file that shows how to create a dynamic Web project using the Assembly Toolkit. In the Assembly Toolkit, click Help > Help Contents > Assembly Toolkit information > Web development > Tasks > Working with Web projects > Creating new dynamic Web projects > Show Me.

  3. Open the J2EE perspective to work with J2EE projects. Click Window > Open Perspective > Other > J2EE.

  4. Click File > New > Dynamic Web Project.

  5. On the Dynamic Web Project page of the New Web Project dialog:

    1. Specify a Web project (WAR file) name.

    2. Specify a location for the WAR file. To change the default WAR files location, click Browse and specify a new location.

    3. Decide whether you want to accept the defaults associated with a dynamic Web project or configure advanced options. If you want to accept the defaults, deselect Configure advanced options. Otherwise, select Configure advanced options and Next. Step 6 describes the defaults and advanced options for a dynamic Web project.

  6. If you selected Configure advanced options, you can customize the Web project options:

    1. Specify a new or existing enterprise application (EAR) project to be associated with your new Web project for purposes of deployment. If you want to add a Web project as a module to another enterprise application project in the future, open the application.xml editor for the enterprise application project and select Add on the General page.

    2. Provide a Context root value. The context root is the Web application root, the top-level directory of your application when it is deployed to a Web server. The default value is the name of your Web project. You can change the context root after you create a project using the project Properties dialog, which you access from the project's context menu.

    3. From the J2EE Level drop-down list, select the appropriate Sun Microsystems Servlet and JSP specification level for the dynamic elements you plan to include in your Web project. Any new servlets and JSP files that you expect to create should adhere to the latest specification level available; previous specification levels are offered to accommodate any legacy dynamic elements that you expect to import into the project.

    4. Click Next.

    5. (Optional)   On the Features Page, select one or more of the Web project features and click Next.

    6. (Optional)   Select Use a default Page Template for the Web Site if you want your entire Web site to share a common page template. If you want to use one of the sample templates provided, select Sample Template and then choose one of the templates shown in the Thumbnail box. If you want to use a template of your own, select User-defined Template and then click Browse to select the template from the file system. The default is not to use a page template.

  7. Click Finish.A new Web project is created, reflecting the J2EE folder structure that specifies the location of web content files, class files, class paths, the deployment descriptor, and supporting metadata.

  8. Verify the contents of the new Web project in either of the following ways:

    • In the J2EE Hierarchy view, expand Enterprise Applications and the enterprise application associated with your Web project to view the new WAR file.

    • Click Window > Show View > Navigator to see the associated files for the Web project in a Navigator view.

 

What to do next

You can now begin creating or importing content for your Web project using the New File wizards or the Import wizards available from the File menu.


Related concepts
Web applications
Web modules
Enterprise applications
Related tasks
Assembling applications with the Assembly Toolkit
Assembling Web applications