Previously, I was puzzled by the problem of the jump path between the servlet and servlet/jsp, and today I did a hands-on experiment and summarized the following:
The servlet is already a resource under the project root path, so when the servlet jumps, it can be added "/" on the jump path, or it can be added to the root path, with an absolute path.
Without "/", it means a relative path, because the servlet itself is already a resource under the root path, so it can be compared to any path in the project.
JSP jump (Commit also jump) to the servlet when add "/" or not, this time you have to look at the location of JSP, if the JSP is out of WebApp, (that is, the root directory) can not add, because the direct
Use a relative path to find the servlet below the original root path, and when the JSP is not in the following path, such as in a folder below the root path, you must add "/" as this
, you cannot directly find the servlet under the root path with a relative path, but you can also use the ". /"represents the parent directory and jumps to the servlet below the root path.
Summary: Although the previous said that the servlet jump can be added "/" can also be added, but the final practice is to add a better, as to not add what the problem, I am not very clear now.
____________nickgan.
2014-10-22
Request forwarding and redirection of JSP servlet