在servlet中转发jsp时request.getRequestDispatcher("/*****.jsp“).forward(request, response);可以转发成功但是在servlet转发action出现错误
这是因为没有在web.xml中定义规则,只需要在web.xml下对应的struts2加上
<filter-mapping>
<filter-name>struts2</filter-name><url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
这两句就可以转发action成功。
运用forward方法只能重定向到同一个Web应用程序中的一个资源。而sendRedirect方法可以让你重定向到任何 URL。
引用了http://www.cnblogs.com/phpzxh/archive/2010/02/01/1661137.html