当前位置: 代码迷 >> Eclipse >> filter 中如何跳传到action 或者 jsp 中调入 List 报错是如何会事啊 急 答案!
  详细解决方案

filter 中如何跳传到action 或者 jsp 中调入 List 报错是如何会事啊 急 答案!

热度:747   发布时间:2016-04-23 14:06:48.0
filter 中怎么跳传到action 或者 jsp 中调入 List 报错是怎么会事啊! 急!!急!!急!! 在线等答案!!
jsp 中引用 list 的错误

System Runtime Error: 
Unable to compile class for JSP: An error occurred at line: 6 in the generated java file Syntax error on token ";", delete this token Stacktrace: 

第六行代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


filter中跳传action的错误 
 404 

request.getRequestDispatcher(path).forward(request, response);
path改了相对路径,绝对路径都试过了还不是行

那位大虾帮帮忙解决下!!!

------解决方案--------------------
RequestDispatcher XX = request.getRequestDispatcher(forwardPath); 
XX.forward(request,response);

XX 是用RequestDispatcher 声名的一个对象, forwardPath 是你要将请求转发到的路径
XX.forward(request,response)就是进行请求转发,其中的request和response 分别是请求和响应对象
比如说,你想将请求转发到a.jsp页面
如下
RequestDispatcher XX = request.getRequestDispatcher("a.jsp"); 
XX.forward(request,response);

lz肯定是你的路径有问题,你在检查下
------解决方案--------------------

filter跳转不要用 request.getRequestDispatcher,应该用response.sendRedirect("绝对路径")
  相关解决方案