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/hello2
and build and deploy the example by runningant
. This runs the default ant targetdeploy
which depends on thebuild
target. Thebuild
target will spawn any necessary compilations and copy files to thedocs/tutorial/examples/web/hello2/build
directory. Thedeploy
target copies the build directory to<JWSDP_HOME>
/webapps
.- Start or restart Tomcat.
- Open the
Hello2
URLhttp://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>
- 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
Hello2
URL.If you make this change, the next time you execute the application, the color of the response will be red:
Home TOC |
![]() ![]() ![]() |