February 22, 2019
Hot Topics:

Easy Web Templates with Oracle JDeveloper 10g

  • June 17, 2005
  • By Chris Schalk
  • Send Email »
  • More Articles »

Archiving Web Templates as J2EE War Files

In the previous steps, you have configured both JDeveloper and a single project to have a specific look and feel; however, in the future you will want to create new Web applications that also have this look and feel. Instead of manually creating the subdirectories, CSS, and images content for each new Web application, you can use JDeveloper J2EE Web Archive (WAR) deployment feature to save an entire Web application as a template that you then can derive new projects from in the future.

  1. To archive this ACME Web application, locate the /WEB-INF/web.xml file, right-click, and select "Create WAR Deployment Profile...."
    Note: This web.xml file exists because you created a JSP. In general, a web.xml will be generated whenever a J2EE Web-tier component such as a Servlet or JSP is created.

  2. Accept the default options for the WAR deployment profile and click "OK."

    Click here for a larger image.

  3. Now, deploy the application as a WAR file to the local filesystem.

    This will place an archived version of the Web application in a WAR file in the local file system. You'll see where it has been deployed to in the Console:
      Wrote WAR file to ....
      Elapsed time for deployment: 5 seconds
      ---- Deployment finished. ---- Jan 18, 2005 6:32:28 PM
  4. To use your new Acme Application Template, you'll create a new project from the deployed WAR file.
    (File->New...->General->Projects->Project from WAR File).

    Click here for a larger image.

  5. Name the new app "NewAcmeApp."

    Click here for a larger image.

  6. In step 2, you specify the location of the recently deployed WAR file, but keep the default location for the "Root Directory for Web Module:."
    When finished, the wizard will unarchive and copy the contents of the WAR file into the new project's location.

    Click here for a larger image.

  7. When the wizard completes, you'll have a new J2EE Web application based on the ACME Web application "template" that you created earlier. You'll also be able to create new "ACME Pages" with the same look and feel using the CSS and images that were archived into the template application!

    Important Note: If you were to move this WAR file to another JDeveloper instance, you would have to re-create the Component Palette customizations for the CSS entry and the ACME page snippet, but this easily done because the custom CSS and ACME page snippet content is now archived within the WAR file.

    Click here for a larger image.

    Also, because the ACME Web application template is archived in a standard J2EE WAR file, it also can be migrated to any other J2EE compliant Application Server or Tool for further use.

Future Web Templating Support in JDeveloper 10.1.3 Production

It should be noted that although this How To shows how it is possible to build Web templates using a combination of existing features in JDeveloper 10.1.3 Preview and the existing production version of JDeveloper 10.1.2, the "official" Web templating support will be available in the next version of JDeveloper 10.1.3 Production (10g release 2) that is due out in the second half of 2005. In addition to the current features of both the 10.1.3 Preview and 10.1.2 production mentioned in this article, the upcoming production version of 10.1.3 will have dedicated Web templating features that will allow users to easily design and work with multiple types of Web templates including HTML, JSP, and even JavaServer Faces templates.


This How-To article has hopefully provided useful tips on how to build and work with J2EE Web application design templates even before the official Web templating support is available in the next JDeveloper version. As you may have noticed, JDeveloper has many useful development features that often can be used for multiple purposes such as the case in the J2EE War deployment feature for Web templates. As JDeveloper continues to transform itself from a traditional Java development environment into more of a Web development environment, you'll be seeing more and more Web-centric development features. Feel free to offer your feedback in the JDeveloper OTN Forum on how JDeveloper can continue evolving better Web development features geared to the Web developer audience as opposed to the traditional Java developer.

About the Author

Chris Schalk is a Principal Product Manager and Java Evangelist for Oracle's application server and development tools division. Chris primary expertise is Web application development he and is responsible for defining the Web development experience for Oracle JDeveloper. Prior to product management, Chris held positions in both software development and technical marketing at Oracle. Before Joining Oracle, he worked at IBM as a software developer. Chris holds a Bachelor's of Science in Applied Mathematics with a specialization in Computer Science from the University of California at Los Angeles.

Chris has written numerous samples and articles for various publications including Javapro and Oracle Magazine and is currently co-authoring JavaServer Faces—The Complete Reference through McGraw-Hill-Osborne. Chris also maintains a popular Blog on J2EE Web development at http://www.jroller.com/page/cschalk.

Page 2 of 2

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date