On the jsp page, img uses tomcat configuration to display images in the absolute path of the Access Server,

Source: Internet
Author: User

On the jsp page, img uses tomcat configuration to display images in the absolute path of the Access Server,

1. Open the server. xml file under tomcat and go to the \ apache-tomcat-7.0.62 \ conf folder.

2. Add

The Code is as follows:

<Host name = "localhost" appBase = "webapps"
UnpackWARs = "true" autoDeploy = "true">

<! -- SingleSignOn valve, share authentication between web applications
Documentation at:/docs/config/valve.html -->
<! --
<Valve className = "org. apache. catalina. authenticator. SingleSignOn"/>
-->

<! -- Access log processes all example.
Documentation at:/docs/config/valve.html
Note: The pattern used is equivalent to using pattern = "common" -->
<Valve className = "org. apache. catalina. valves. AccessLogValve" directory = "logs"
Prefix = "localhost_access_log." suffix = ". txt"
Pattern = "% h % l % u % t & quot; % r & quot; % s % B"/>
<Context path = "/ompa/uploads/" docBase = "G: \ ompa \ uploads \" reloadable = "true"> </Context>
</Host>

3. Start the tomcat deployment project. The jsp code is as follows:

<! --/Ompa/uploads/is consistent with <Context path = "/ompa/uploads/"...>

Related Article

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.