HTML and CSS Reference
In-Depth Information
After running the previous command, the resources will be added to your GlassFish server. Finally Listing 10-22
shows the single APP_USER table we have in weatherDB .
Listing 10-22. APP_USER TABLE DDL Script
CREATE TABLE APP_USER (
ID VARCHAR(64) PRIMARY KEY,
FIRST_NAME VARCHAR(32),
LAST_NAME VARCHAR(32),
PASSWORD VARCHAR(32),
PROFESSION VARCHAR(32),
EMAIL VARCHAR(64),
ZIP_CODE VARCHAR(32)
);
The weatherDB is a JavaDB Derby database; it is included with the application source code under (src/main/database)
directory for your reference. In order to install the database in your GlassFish server, stop your GlassFish server if it is
running as follows:
> asadmin stop-domain domain1
We are here assuming that your GlassFish domain name is (domain1). After stopping the server, also stop
GlassFish Java DB as follows:
> asadmin stop-database
After stopping the server and Java DB, copy weatherDB directory located under ( src/main/database ) directory to
your ( [GlassFish server]/glassfish/databases ) directory, and then start the server and Java DB. Java DB can start
using the following command:
> asadmin start-database
After starting the server and Java DB, you can deploy the weather application in your GlassFish server and start
using it.
the weather application is a Maven web project, so in order to build it, you can use mvn clean install
command and then deploy the output war file (weather-1.0-snapshot.war) in your glassFish 4 server. note that the
output war file will be located under the target directory. in order to run the Maven command correctly, make sure that
JaVa_hoMe points to the Java 7 directory installed in your operating system.
Note
Summary
In this chapter, you learned in detail how to create a Basic JSF 2.2 application in Java EE 7 environment. You understood
how to structure the JSF 2.2 application. You learned how to utilize the JSF 2.2 Faces Flow in order to handle the flow
between common pages. Finally, you learned how to utilize different Java EE 7 technologies (CDI, JPA 2.1, and EJB 3.2)
in order to facilitate bean management, transaction management, and persistence in your JSF application.
 
 
Search WWH ::




Custom Search