|
Home TOC |
|
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:
- Go to
docs/tutorial/examples/hello2and build and deploy the example by runningant. This runs the default ant targetdeploywhich depends on thebuildtarget. Thebuildtarget will spawn any necessary compilations and copy files to thedocs/tutorial/examples/web/hello2/builddirectory. Thedeploytarget copies the build directory to<JWSDP_HOME>/webapps.- Start or restart Tomcat.
- Open the
Hello2URLhttp://localhost:8080/hello2.Now modify one of the JSP files. For example, you could replace the contents of
response.jspwith:<h2><font color="red">Hello, <%=username%>!</font></h2>
- Edit
response.jsp.- Execute
ant.- Reload the application as described in Reloading the Examples by loading the URL
http://localhost:8080/manager/reload?path=/hello2.- Reload the
Hello2URL.If you make this change, the next time you execute the application, the color of the response will be red:
|
Home TOC |
|