Updated: 12/3/2004; 11:46:10 AM.
Srini Raman's Radio Weblog
        

Monday, November 29, 2004

Creation Wizards

Visual Editor: Creation Wizards in JDeveloper 10.1.3

When you create a HTML or JSP file in JDeveloper 10g, it brings up a dialog which looks like this

Here, all you can enter was filename and the directory where the file needs to be created.

In JDeveloper 10.1.3, we have introduced creation wizards for HTML and JSP file creation.

HTML Creation Wizard

To create a html file, do File->New->Web Tier->HTML->HTML Page

The first page is the welcome page, which you can skip the next time when you create a HTML page. To skip the welcome page, select the 'Skip this page Next Time' checkbox.

In the 'HTML File' page, you enter the name of the file and the directory.

The next page is something new to 10.1.3.

In 'HTML Options' page you can specify

     
  • the doctype that should be used in the page
  • title of the page 
  • background image of the page
  • background color of the page 
  • link color of the page (color used for all the links in the page)
  • style sheets that should be used in the page (you can specify as many style sheets as you want)

The values you specify in this page are saved/cached. So, when you create another HTML Page, the values that you entered last time are automatically updated in this page. Say, you select 'yellow' for the background color;  next time when you go through this wizard, yellow color is selected for background color option.

Note: Go ahead and specify background color, background image, link color and see how we do code generation for these in the html file. Instead of setting html properties on <body> tag, document CSS style is created, like the folllowing example. The best way to use CSS styles is through external style sheets.

<style type="text/css">
body { background-color: #ffb563; }
a:link { color: #ff0000; }
</style>

JSP Creation Wizard

To create a JSP file/page, do File->New->Web Tier->JSP->JSP. This will bring up the wizard for JSP file creation. JSP wizard uses some of the pages that we saw in HTML wizard. In addition to that, JSP wizard adds JSP specific items/pages also.

In the 'Web Application' page, you can select the web application version (J2EE 1.4 or J2EE 1.3) that you want to use in your project. If your project is not setup for web application (ie., no web.xml file), this page will show up. If there is a web.xml file already in your project, then this page will not be shown.

What's the implication of selecting the web application version? 

  • web.xml file is created in WEB-INF directory

The 'JSP File'  page is similar to the 'HTML File' page in HTML wizard. But, in addition to the filename and directory name, you can see few other options. Here, you can select whether the page to be created is a JSP Page or a JSP Document. The main difference between these two is that the Document follows the xml syntax (ie., well-formed). If you are not familiar with this, just stick with the default selected option (which is JSP Page). This page also provides error page options, which I will blog as a separate article.

The 'Tag Libraries' page allows you to select the tag libraries that should be used in the page. On the left side, you can see all the tag libraries known (or registered) with JDeveloper. Using the shuttle UI, you can move tag libraries from the left side to the right side.

So, what's the implication of selecting a tag library?

  • a taglib directive is added to the page (Ex: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>) for each of the tag libraries selected in this page. 
  • the jar file corresponding to the tag library gets copied to the WEB-INFlib directory.
  • if the tag library is associated with a technology scope, the technology scope is added to the project, if neccessary.

Note
  - In addition to HTML and JSP file creation, we have wizard for creating JSP Tag File and JSP Tag Library
  - For JSF-JSP (Faces) wizard, JSF related tag libraries are pre-selected in the 'Tag Libraries' page.

  - For a JSF-JSP page, Faces Configuration file (faces-config.xml) is created, if it does not exists


2:26:19 PM    comment []

© Copyright 2004 Srinivasan T. Raman.
 
November 2004
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
Sep   Dec


Click here to visit the Radio UserLand website.

Subscribe to "Srini Raman's Radio Weblog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.