java web project to configure Tomcat to access files outside the project

    1, in the presence of D 111.png code: \ aaa \ of the path

    2, modify the server.xml tomcat conf folder in context

      <Context path="/aaa" docBase="D:\aaa" debug="0"  reloadable="true" />

    3. access; for example, your current project path http: // localhost: 8080 / ggxs / index.jsp

      Pictures path: http: // localhost: 8080 / aaa / 111.png

 

   Remember our path configuration and then access the tomcat is without project name (ggxs) directly at http: // localhost: 8080 Alias ​​/ tomcat configuration / file name

 

 

                                        -------- only continue to be helped moved.

Guess you like

Origin www.cnblogs.com/lt3232696/p/12470288.html