This actually has three principles:
1. If this address is the starting point for this address to the server, start writing from the Web App
2. If this address is the beginning of the address to the browser, start writing from the site
3. All addresses start with a "/", representing the Web app or website
Commonly used addresses to write:
1.request.getrequestdispatcher ("/form1.html"). Forward (request,response); This forwarding is for the server to operate, so "/" represents the Web App
2.response.sendredirect ("/webapplication/form1.html"); Because this is a browser that needs to be manipulated, the redirected
3.this. Servletcontext.getrealpath ("/form1.html"); This is the acquisition of resources on the server, related to the server
4.this. Servletcontext.getresourceasstream ("/form1.html"); This is also related to the server, get the flow of the resource
5.<form action= "/webapplication/form1.html"/> form to be submitted to the browser, so "/" starts from the site
6.<a href= "/webapplication/form1.html" > click </a> hyperlink jump is also done by the browser, so start writing from the website
The writing of various types of addresses in Java Web development