10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>The</strong> Example JSP Pages<br />

272<br />

3. In the Open Project dialog, navigate to:<br />

tut-install/javaeetutorial5/examples/jaxws/<br />

4. Select the webclient folder.<br />

5. Select the Open as Main Project check box and the Open Required Projects check box.<br />

6. Click Open Project.<br />

7. In the Projects tab, right-click the webclient project, and select Undeploy and Deploy.<br />

8. To run the application, open the bookstore URL<br />

http://localhost:8080/webclient/greeting.<br />

To deploy and run the webclient example using ant, follow these steps:<br />

1. Build and deploy the JAX-WS web service MyHelloService described in “Building,<br />

Packaging, and Deploying the Service” on page 480.<br />

2. In a terminal window, go to tut-install/javaeetutorial5/examples/jaxws/webclient/.<br />

3. Run ant. This target will spawn any necessary compilations, will copy files to the<br />

tut-install/javaeetutorial5/examples/jaxws/webclient/build/ directory, will create a<br />

WAR file, and will copy it to the<br />

tut-install/javaeetutorial5/examples/jaxws/webclient/dist directory.<br />

4. Start the Application Server.<br />

5. To deploy the example using ant, run the following command:<br />

ant deploy<br />

6. To run the example, open your browser to http://localhost:8080/webclient/greeting.<br />

To learn how to configure the example, refer to the deployment descriptor (the web.xml file),<br />

which includes the following configurations:<br />

■ A display-name element that specifies the name that tools use to identify the application.<br />

■ A set of servlet elements that identify the application’s JSP file.<br />

■ A servlet-mapping element that defines the alias to the JSP file.<br />

Note – <strong>The</strong> example assumes that the Application Server runs on the default port, 8080. If<br />

you have changed the port, you must update the port number in the file<br />

tut-install/javaeetutorial5/examples/jaxws/webclient/response.jsp before building<br />

and running the example.<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!