当前位置: 代码迷 >> Java Web开发 >> tomcat7 与tomcat 6 对request.getRequestDispatcher支持不同么 求救指正解决办法
  详细解决方案

tomcat7 与tomcat 6 对request.getRequestDispatcher支持不同么 求救指正解决办法

热度:895   发布时间:2016-04-17 00:31:52.0
tomcat7 与tomcat 6 对request.getRequestDispatcher支持不同么 求救指正
该段段程序在tomcat6 下执行正常,在tomcat7下报错,请求高手指点迷津!谢谢

程序功能:登陆,取到一个list然后,写入到request中,然后跳转到新的页面在其上显示列表。

登陆验证部分没有问题 ,代码出现在这个servlet中,红色语句出现异常:
Java code
import java.io.IOException;import java.util.ArrayList;import java.util.Collection;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import com.city.gameroll.bussiness.IGroupBusiness;import com.city.gameroll.factory.BusinessFactory;import com.city.gameroll.value.GroupValue;public class LoginGetGameListAction extends HttpServlet {    public void doGet(HttpServletRequest request, HttpServletResponse response)            throws ServletException, IOException {                IGroupBusiness gb=BusinessFactory.getGroup();        try {            //取得gamelist            Collection<GroupValue> waitGameList = new ArrayList<GroupValue>();            waitGameList=gb.getWaitGameList();            request.setAttribute("waitGameList", waitGameList);//此处出线异常            request.getRequestDispatcher("user/main.jsp").forward(request, response);         } catch (Exception e) {            System.out.println("LoginGetGameListAction出错"+e.getMessage());        }                    }        public void doPost(HttpServletRequest request, HttpServletResponse response)            throws ServletException, IOException {        doGet(request,response);    }}


在tomcat7下运行时,在注释部分抛出异常:
LoginGetGameListAction出错The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
2011-2-15 17:05:05 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:53)
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.generateTLDLocation(TagLibraryInfoImpl.java:310)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:152)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1425)
at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:197)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:365)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:345)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:342)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
  相关解决方案