The Example JSP Pages
This chapter illustrates JSP scripting elements using
webclient
, a version of thehello1
example introduced in Chapter 2 that accesses a web service.To deploy and run the
webclient
example using NetBeans 5.5, follow these steps:
- Build and deploy the JAX-WS web service
MyHelloService
described in Building, Packaging, and Deploying the Service.- In NetBeans 5.5, select File
Open Project.
- In the Open Project dialog, navigate to:
<INSTALL>/javaeetutorial5/examples/jaxws/
- Select the
webclient
folder.- Select the Open as Main Project checkbox and the Open Required Projects checkbox.
- Click Open Project Folder.
- In the Projects tab, right-click the
webclient
project, and select Deploy Project.- To run the application, open the bookstore URL
http://localhost:8080/webclient/greeting
.To deploy and run the
webclient
example usingant
, follow these steps:
- Build and deploy the JAX-WS web service
MyHelloService
described in Building, Packaging, and Deploying the Service.- In a terminal window, go to
<
INSTALL
>/javaeetutorial5/examples/jaxws/webclient/
.- Run
ant
. This target will spawn any necessary compilations, will copy files to the<
INSTALL
>/javaeetutorial5/examples/jaxws/webclient/build/
directory, will create a WAR file, and will copy it to the<
INSTALL
>/javaeetutorial5/examples/jaxws/webclient/dist
directory.- Start the Application Server.
- To deploy the example using
ant
, run the following command:
ant deploy
- To run the example, open your browser to
http://localhost:8080/webclient/greeting
.To learn how to configure the example, refer to the deployment descriptor (the
web.xml
file), which includes the following configurations:
Note: The example assumes that the Application Server runs on the default port, 8080. If you have changed the port, you must update the port number in the file
<
INSTALL
>/javaeetutorial5/examples/jaxws/webclient
/response.jsp
before building and running the example.