The JavaTM Web Services Tutorial
Home
TOC
PREV TOP NEXT

Updating Web Applications

During development, you will often need to make changes to Web applications. To modify a servlet you modify the source file, recompile the servlet class, and redeploy the application. Except for the compilation step, you update a JSP page in the same way.

To try this feature, first build and deploy the JSP version of the Hello application:

  1. Go to docs/tutorial/examples/hello2 and build and deploy the example by running ant. This runs the default ant target deploy which depends on the build target. The build target will spawn any necessary compilations and copy files to the docs/tutorial/examples/web/hello2/build directory. The deploy target copies the build directory to <JWSDP_HOME>/webapps.
  2. Start or restart Tomcat.
  3. Open the Hello2 URL http://localhost:8080/hello2.

Now modify one of the JSP files. For example, you could replace the contents of response.jsp with:

<h2><font color="red">Hello, <%=username%>!</font></h2>
 
  1. Edit response.jsp.
  2. Execute ant.
  3. Reload the application as described in Reloading the Examples by loading the URL http://localhost:8080/manager/reload?path=/hello2.
  4. Reload the Hello2 URL.

If you make this change, the next time you execute the application, the color of the response will be red:

Figure 3 Red Response

Home
TOC
PREV TOP NEXT