Download
FAQ History |
API
Search Feedback |
The Example JSP Pages
This chapter illustrates JSP scripting elements using
webclient
, a version of thehello1
example introduced in Chapter 3 that accesses a Web service. To build, package, deploy, and run thewebclient
example, follow these steps:
- Build and deploy the JAX-RPC Web service
MyHelloService
described in Creating a Simple Web Service and Client with JAX-RPC.- In a terminal window, go to
<
INSTALL
>/j2eetutorial14/examples/jaxrpc/webclient/
.- Run
asant
build
. This target will spawn any necessary compilations and will copy files to the<
INSTALL
>/j2eetutorial14/examples/jaxrpc/webclient/build/
directory.- Start the Application Server.
- Start
deploytool
.- Create a Web application called
webclient
by running the New Web Component wizard. Select FileNewWeb Component.- In the New Web Component wizard:
- Select the Create New Stand-Alone WAR Module radio button.
- Click Browse and in the file chooser, navigate to
<
INSTALL
>/j2eetutorial14/examples/jaxrpc/webclient/
.- In the File Name field, enter
webclient
.- Click Choose Module File.
- In the WAR Display Name field, enter
webclient
.- In the Context Root field, enter
/webclient
.- Click Edit Contents.
- In the Edit Contents dialog box, navigate to
<
INSTALL
>/j2eetutorial14/examples/jaxrpc/webclient/build/
. Selectduke.waving.gif
,greeting.jsp
,response.jsp
, and thewebclient
directory, and click Add.- Click OK.
- Click Next.
- Select the JSP Page radio button.
- Click Next.
- Select
greeting.jsp
from the JSP Filename combo box.- Click Finish.
- Add an alias to the
greeting
Web component.- Select FileSave.
- Deploy the WAR.
- Open your browser to
http://localhost:8080/webclient/greeting
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
>/j2eetutorial14/examples/jaxrpc/webclient
/response.jsp
before building and running the examples.
Download
FAQ History |
API
Search Feedback |
All of the material in The J2EE(TM) 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.