Access the JSP file inside the Web-inf

Source: Internet
Author: User

JSP files in the Web-inf directory are not directly accessible in the browser. (no permission to access)

If you put the JSP file into the Web-inf directory, you will not be able to access it.

For example, write directly in the JSP page

1 <a href= "/web-inf/content/index.jsp" >

Then it will not be accessible.

In struts, you must use action to jump the page in order to access the JSP file inside the Web-inf.

Write the link in the JSP page above as:

<a href=index.action>

Add this sentence to the Struts configuration file:

1  <action name= "*" >  2       <result>/WEB-INF/content/{1}.jsp</result>  3   </action>  

This means that all action on the page jumps to the JSP page for the action under/web-inf/conent/. Of course, if the other specific action is top-justified, it jumps to the corresponding JSP page.

By adding the above action, the hyperlink to the page is positioned below the Web-inf/content directory.

Access the JSP file inside the Web-inf

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.