tomcat中server.xml配置对项目的影响!5.5

host下配置context,其中有path和docbase2个属性,我将path设置为/ 运行项目打开浏览器查看源码显示path=request.getContextPath();是一个斜杠,所以这个是不对的,果断设置为空。设置为空就默认是得到项目的名!即WEB-INF的父目录名!

 

看到的朋友能不能帮我解决一个问题:

我这个项目2个地方部署,一个在万网,一个是自己装的VPS中,万网一切正常,但是VPS中的部署好后也可以访问,打开首页的什么都没问题,但是老是报一个奇怪的异常,经查看好像是无法获取session,例如验证码是存放在session里的,然后action里从session中拿到该值,却为空!每次都是这样,本地、万网,服务器都没有问题,请问是什么问题!

错误代码:

2011-2-21 16:23:24  org.apache.jasper.compiler.TldLocationsCache processWebDotXml
警告:  Internal Error: File /WEB-INF/web.xml not found
2011-2-21 16:23:24 org.apache.catalina.core.StandardWrapperValve invoke
严重:  Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: File "/WEB-INF/struts-tags.tld" not found
        at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
        at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
        at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
        at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:160)
        at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:430)
        at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:499)
        at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1558)
        at org.apache.jasper.compiler.Parser.parse(Parser.java:130)
        at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:245)
        at org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
        at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:161)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:326)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:307)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
        at java.lang.Thread.run(Thread.java:595)
 

你可能感兴趣的:(linux)