Web-inf Related Directory path summary
1, the resource files can only be placed under the webcontent, such as Css,js,image and so on. It can't be quoted under Web-inf.
2, the page is placed under the Web-inf directory, this can restrict access, improve security. such as jsp,html
3, can only use the steering way to access the JSP in the Web-inf directory, do not have to redirect the way to request any resources in the directory.: index.jsp >> main.jsp
4, Web-inf directory when the file access resource files, you can ignore Web-inf this layer of directory. If main.jsp want to use a CSS file in the CSS directory.
<link rel= "stylesheet" type= "Text/css" href= "Css/comm201005faa3.css"/> This is OK, from the client's address can be seen
The server steering main.jsp is under Webroot. So main.jsp and CSS directories can be said to be the same level directory.
5. Access the images directory under the Web-inf/oa directory. </body> still this way.
6. How to access the files in the Web-inf directory, as in the main.jsp with <a href= "oa.do" > Test OA path </a> access
Like main.jsp, there are 10 links to other pages in the Web-inf directory. Then there must be 10 steering action. This can be handled with the Dispatchaction class plus parameters specifically for the steering work.
Note:
Steering Mode: Forward
Configure <forward Name= "Success" path= "/web-inf/main.jsp"/> in the Struts-config file or write R in actionEquest.getrequestdispatcher("/web-inf/main.jsp"). Forward (request, response);the server reads the contents of the page and sends it to the client. The address of the client is unchanged. Content Jumps
REDIRECT mode: Redirect
Configure <forward Name= "Success" Path= "/web-inf/main.jsp" as in the Struts-config fileredirect= "true"/>
or in the actionResponse.sendredirect("/error.jsp");the meaning of redirection is that the server sends the address to the client and allows the client to access it. This approach is obviously not working for the Web-inf catalogue..
Web-inf about the directory path summary, Steering mode: Forward redirection mode: Redirect