Step 3. Create a new Hibernate Web Application Project
A web application project is an Eclipse 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. In this step, you will create a new web application project and review the default artifacts.
Undeploy Previous Tutorial Code
WebLogic Server does not support the deployment of projects with the same
name from two different locations on disk.
For this reason, anytime you deploy a sample or run through a tutorial, you
should check your server for previous deployments of the same code. If your
server already has a deployment of the sample or tutorial code, you should undeploy
any previous code.
Ensure that you are connected to the Internet. In this step libraries and
project files will be automcatically downloaded from the BEA website.
Open Workshop in a new workspace. (If Workshop opens in an existing workspace, create a new workspace by clicking File > Switch Workspace then choosing Browse and clicking Make New Folder to create a new workspace folder).
Click New Example Web Project on the AppXplorer view.
The New Example wizard provides various options for creating
a new web application project. Choose Workshop Hibernate Examples
> Workshop Hibernate Tutorial from
the list.
Click Next.
The default name for the project is workshop-hibernate-tutorial.
You can keep the default name or change it to any name you wish. Click Next.
The next screen is a Hibernate license. Review the license carefully and if you accept the terms, click on I Agree. If you do not agree to the license, then you will not be able to use Hibernate tools and the Hibernate example in Workshop. If you do agree, then the Hibernate libraries will be downloaded and installed.
Review the Java build settings. By default, workshop-hibernate-tutorial/web/WEB-INF/src/java is
selected as source folder and workshop-hibernate-tutorial/web/WEB-INF/classes as
output folder.
Click Finish to create the new Hibernate web application
project.
Review the Web Application Artifacts
Below is the summary of different parts of the web application structure
as seen in the AppXplorer view.
Folder or file
Overview
workshop-hibernate-tutorial
Project folder with project name
/web (Web App Root)
Root folder for web application artifacts
/Faces Configuration
Lists JSF configuration elements
/Hibernate Configuration
Displays list of Hibernate persistent entities
/pages
Folder for HTML and JSP presentation pages
/hsqlDB
Hypersonic database files for the underlying database used in the example
/Resources
Supporting files being used in Hibernate application
/WEB-INF
Holds folders / files used as part of the runtime Web application
/classes
Holds class files for the web application
/config
Holds JSF configuration file
/lib
Folder to place third-party .jar files which is used at run-time i.e. .jar file for logging, tag libraries, JDBC drivers etc.
/src/java
Folder to place java source files
/tld
Folder to place tag library definition files
web.xml
Deployment descriptor for web application
/web/WEB-INF/src/java
Folder that maps to src/java folder where you can place java source files
/resources
Folder to place the resource files
application.properties
Application configuration resource file
hibernate.cfg.xml
Hibernate configurations file
/Referenced Types
Java classes referenced by web artifacts
Click one of the following arrows to navigate through the tutorial: