Sie sind auf Seite 1von 4

JSF Tutorial: 1.

Create a New Web Application Project

http://docs.oracle.com/cd/E13224_01/wlw/docs103/guid...

1. Create a New Web Application Project


A Web application project is an Eclipse Java project that contains the source code, web pages, images, resources, and configuration files for building a Java program that can be deployed to a web container.

1.1. Create new web application project


1. From the AppXplorer view, click on New Example Web Project . Expand the node JSF, select Workshop JSF Tutorial, and click Next.

2. Specify the location for your tutorial and click Finish to create the project.

1 of 4

11/26/2011 09:28 PM

JSF Tutorial: 1. Create a New Web Application Project

http://docs.oracle.com/cd/E13224_01/wlw/docs103/guid...

During the tutorial well make extensive use of the following views: AppXplorer view AppXplorer logically organizes web artifacts allowing you to browse web components and manage web application projects. It groups Java classes referenced by the web artifacts under Referenced Types. Design Palette view The Design Palette view lists the standard JSP and HTML tag libraries, the tag libraries declared in the web.xml file, and the tag libraries defined in your web application. It provides an easy way to insert tags into your documents by providing access to tag editors and wizards. When you drag a tag from the palette and drop it into a page, it opens a wizard to specify the tag information, and the corresponding source code is generated automatically. The JSP Variables section of the Design Palette view: This displays the variables available to the current JSP page and allows inserting variables in the page and navigating in the Java code associated with the variables. Properties view for tag editing The Properties view provides three types of tag editors

2 of 4

11/26/2011 09:28 PM

JSF Tutorial: 1. Create a New Web Application Project

http://docs.oracle.com/cd/E13224_01/wlw/docs103/guid...

Smart Editor: This is a custom editor for efficiently editing the most commonly used attributes for a tag. Property Sheet: This displays all the tag attributes and their values. Tag Selector: This is located at the bottom of the Properties view and is used to activate the tag editor for a specific tag in a tag hierarchy. Outline view This displays the structure of Java classes and web components in a tree form.

1.2. Review web artifacts


This is a summary of the different parts of the web application structure. Folder or file workshop-jsf-tutorial /web (Web App Root) /Faces Configuration /META-INF /pages /Resources Overview Project folder with project name. Root folder for web application artifacts. Lists JSF configuration elements. Contains metadata for your application. Folder for HTML and JSP presentation pages. Support files (.java and .jsp files) and resources (images, .css file) for JSF application. Text files containing statements for reference. Holds folders / files used as part of the runtime Web application. Holds class files for the web application. Folder for configuration files. JavaServer faces configuration file. Folder to place third-party .jar files which is used at run-time i.e. .jar file for logging, tag libraries, JDBC drivers etc. Folder to place Java source files. Folder to place tag library definition files. Deployment descriptor for web application Folder that maps to src/java folder where you can place java source files. Folder to place the resource files.

/Typing_Aid /WEB-INF

/classes /config faces-config.xml /lib

/src/java /tld web.xml /web/WEB-INF/src/java

/resources

3 of 4

11/26/2011 09:28 PM

JSF Tutorial: 1. Create a New Web Application Project

http://docs.oracle.com/cd/E13224_01/wlw/docs103/guid...

application.properties /Referenced Types

Application configuration resource file. Java classes referenced by web artifacts.

Click one of the following arrows to navigate through the tutorial:

Still need help? Post a question on the Workshop newsgroup.

4 of 4

11/26/2011 09:28 PM

Das könnte Ihnen auch gefallen