zoukankan      html  css  js  c++  java
  • Tomcat 映射虚拟目录

    tomcat的conf目录下的server.xml文件中

    <!-- <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 "%r" %s %b" />
    	 
          </Host>
    	   恢复默认要取消这边的注释
    	   -->
    	    <!-- 配置虚拟路径 -->
    	  <Host name="localhost" appBase="webapps"></Host>
    	  <Host name="www.juyuanmeihui.com" appBase="juyuanmeihui">
    		  <Context path="/" docBase="D:JYCJshopWebContent" ></Context> 
    	  </Host>
    

    然后修改host文件

    #默认配置,不必修改
    127.0.0.1       localhost
    127.0.0.1	www.juyuanmeihui.com
    

    这时只需要运行tomcat而且不需要部署这个项目 

    如图

     

    但是可能会出现下面这种情况

    严重: Error configuring application listener of class com.enation.eop.sdk.listener.EopSessionListener
    java.lang.ClassNotFoundException: com.enation.eop.sdk.listener.EopSessionListener
    

    class文件找不到报异常

    这时关闭tomcat,设置项目的class输出目录,设置为javamall/WebContent/WEB-INF/classes

    然后确定,重启tomcat即可,这时你可以通过访问

    www.juyuanmeihui.com来访问本地的javamall项目了。
  • 相关阅读:
    [HDU 2089]不要62
    [WC 2011]Xor
    [BJOI 2011]元素
    [NOIp 2014]解方程
    [UVa 1326]Jurassic Remains
    [BZOJ 2152]聪聪可可
    [IOI 2011]Race
    [测试题]打地鼠
    [POJ 2828]Buy Tickets
    [测试题]gene
  • 原文地址:https://www.cnblogs.com/nbkyzms/p/5109068.html
Copyright © 2011-2022 走看看