Web-inf about the directory path summary, Steering mode: Forward redirection mode: Redirect

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.