The Example JSP Pages


This chapter illustrates JSP scripting elements using webclient, a version of the hello1 example introduced in Chapter 2 that accesses a web service.

To deploy and run the webclient example using NetBeans 5.5, follow these steps:

1.

Build and deploy the JAX-WS web service MyHelloService described in Building, Packaging, and Deploying the Service (page 511).

2.

In NetBeans 5.5, select FileOpen Project.

3.

In the Open Project dialog, navigate to:

<INSTALL>/javaeetutorial5/examples/jaxws/


4.

Select the webclient folder.

5.

Select the Open as Main Project checkbox and the Open Required Projects checkbox.

6.

Click Open Project Folder.

7.

In the Projects tab, right-click the webclient project, and select Deploy Project.

8.

To run the application, open the bookstore URL http://localhost:8080/webclient/greeting.

To deploy and run the webclient example using ant, follow these steps:

1.

Build and deploy the JAX-WS web service MyHelloService described in Building, Packaging, and Deploying the Service (page 511).

2.

In a terminal window, go to <INSTALL>/javaeetutorial5/examples/jaxws/webclient/.

3.

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.

4.

Start the Application Server.

5.

To deploy the example using ant, run the following command:

ant deploy


6.

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:

  • A display-name element that specifies the name that tools use to identify the application.

  • A set of servlet elements that identify the application's JSP file.

  • A servlet-mapping element that defines the alias to the JSP file.

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.




The JavaT EE 5 Tutorial
The JavaT EE 5 Tutorial
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 309

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net