Java Reference
In-Depth Information
To Build, Package, and Deploy the
decorators
Example Using NetBeans IDE
1. From the File menu, choose Open Project.
2. In the Open Project dialog, navigate to:
tut-install
/examples/cdi/
3. Select the
decorators
folder
.
4. Select the Open as Main Project check box.
5. Click Open Project.
6. In the Projects tab, right-click the
decorators
project and select Deploy.
To Build, Package, and Deploy the
decorators
Example Using Ant
1. In a terminal window, go to:
tut-install
/examples/cdi/decorators/
2. Type the following command:
ant
This command calls the
default
target, which builds and packages the applica-
tion into a WAR file,
decorators.war
, located in the
dist
directory.
3. Type the following command:
ant deploy
To Run the
decorators
Example
1. In a web browser, type the following URL:
http://localhost:8080/decorators
The Decorated String Encoder page opens.
2. Type a string and the number of letters to shift by, then click Encode.
The output from the decorator method appears in blue on the Result line. For ex-
ample, if you typed
Java
and
4
, you would see the following:
"Java" becomes "Neze", 4 characters in length
3. Examine the server log output.
In NetBeans IDE, the output is visible in the GlassFish Server 3+ output window.
Otherwise, view
domain-dir
/logs/server.log
.
The output from the interceptors appears: