struts部署的问题!!请帮我看看为什么
最近用struts+spring+hibernate做了一个项目,可是部署的时候遇到了问题,就是路径问题,我首先说一下我的环境:
struts 1.2.8
hibernate 3.1
spring 1.2
tomcat 5.5.4
我的工程在我的测试环境里面,运行都是正常,但是当我部署到tomcat以后,原来要通过http://localhost:8080/MMEE/WEB-PAGES/pages/index.jsp来到首页,但是我想只输入http://localhost:8080/,就可以连接到首页,我的做法是在
tomcat的安装文件夹里面conf文件夹里的server.xml文件中加入了
<Context path= " " docBase= "D:\Tomcat 5.5\webapps\MMSiS\WEB-PAGES\pages " debug= "0 ">
</Context>
这段我加到了 </Host> 标记的前面,但是当我输入了http://localhost:8080/,index.jsp网页好像是连接到了index.jsp但是有错误:
org.apache.jasper.JasperException: File "/WEB-INF/struts-bean.tld " not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:114)
org.apache.jasper.compiler.TagLibraryInfoImpl. <init> (TagLibraryInfoImpl.java:159)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
说我的struts标签找不到,但是如果输入完整的路径:http://localhost:8080/MMEE/WEB-PAGES/pages/index.jsp,就一切ok
我的index.jsp标签的引用如下:
<%@ page language= "java " pageEncoding= "UTF-8 "%>
<%@ taglib uri= "/WEB-INF/struts-bean.tld " prefix= "bean "%>
<%@ taglib uri= "/WEB-INF/struts-html.tld " prefix= "html "%>
我的web.xml的内容如下:
<?xml version= "1.0 " encoding= "UTF-8 "?>
<web-app xmlns= "http://java.sun.com/xml/ns/j2ee " xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance " version= "2.3 " xsi:schemaLocation= "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_3.xsd ">
<welcome-file-list>
<welcome-file> index.jsp </welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri&