How to directly access files under the WEB-INF, access the web-inf file

Source: Internet
Author: User

How to directly access files under the WEB-INF, access the web-inf file

<Servlet> <servlet-name> HE </servlet-name> <jsp-file>/WEB-INF/u_member/Login. jsp </jsp-file> </servlet> <servlet-mapping> <servlet-name> HE </servlet-name> <url-pattern>/Login. jsp </url-pattern> </servlet-mapping>
After configuration, you can directly access Login. jsp.

How does Struts access jsp files under the WEB-INF directory?

Jsp files under the WEB-INF directory cannot be accessed directly in the browser. (No access permission) if you put the jsp file under the WEB-INF directory, it will not be accessible. For example, writing <a href =/WEB-INF/content/index. jsp directly on the jsp page will not be accessible. In struts, you must use action to achieve page Jump, in order to access the jsp file in the WEB-INF. Write the link in the preceding jsp page as: <a href = index. action in the struts configuration file to add such a sentence: <action name = * <result/WEB-INF/content/{1 }. jsp </result </action indicates that all actions on the page will jump to the jsp page of the corresponding action under/WEB-INF/conent. Of course, if other specific actions are prefixed, the corresponding jsp page is displayed. By adding the above action, the page hyperlink is positioned below the WEB-INF/content directory.

How to access files under the WEB-INF directory

I am not a master either .. However, this does not seem to be the correct method.

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.