用Spring集成Struts时老出Servlet action is not available
来源:互联网 发布:java unicode编码 编辑:程序博客网 时间:2024/06/07 02:43
Servlet中有两种方式获得转发对象(RequestDispatcher):一种是通过HttpServletRequest的getRequestDispatcher()方法获得,一种是通过ServletContext的getRequestDispatcher()方法获得;
重定向的方法只有一种:HttpServletResponse的sendRedirect()方法。
这三个方法的参数都是一个URL形式的字符串,但在使用相对路径或绝对路径上有所区别。
★ HttpServletResponse.sendRedirect(String)
参数可以指定为相对路径、绝对路径或其它Web应用。
假设通过http://localhost/myApp/cool/bar.do请求到达该方法所属的Servlet。
相对路径:response.sendRedirect("foo/stuff.do")
容器相对于原来请求URL的目录加参数来生成完整的URL——http://localhost/myApp/cool/foo/stuff.do。
绝对路径:response.sendRedirect("/foo/stuff.do")
容器相对于Web应用本身加参数建立完整的URL——http://localhost/foo/stuff.do。
其它Web应用:response.sendRedirect("http://www.javaeye.com")
容器直接定向到该URL。
★ HttpServletRequest.getRequestDispatcher(String)
参数可以指定为相对路径或绝对路径。
相对路径情况下生成的完整URL与重定向方法相同。
绝对路径与重定向不同,容器将相对于Web应用的根目录加参数生成完整的URL,即:
request.getRequestDispatcher("/foo/stuff.do")生成的URL是http://localhost/myApp/foo/stuff.do。
★ ServletContext.getRequestDispatcher(String)
参数只能指定为绝对路径,生成的完整URL与HttpServletRequest.getRequestDispatcher(String)相同。
- 用Spring集成Struts时老出Servlet action is not available
- 用Spring集成Struts时老出Servlet action is not available错
- Struts集成Spring出错:Servlet action is not available 的解决
- Struts集成Spring出错:Servlet action is not available 的解决
- Struts集成Spring出错:Servlet action is not available 的解决
- Struts集成Spring出错:Servlet action is not available 的解决
- Struts集成Spring出错:Servlet action is not available 的解决
- Struts集成Spring出错:Servlet action is not available 的解决
- Servlet action is not available(Struts+Spring+Hibernate)
- 整合Spring+Hibernate+Struts时抛Servlet action is not available异常解决
- Struts:HTTP Status 404 - Servlet action is not available
- Servlet action is not available
- Servlet action is not available
- Servlet action is not available
- Servlet Action is not available
- Servlet action is not available
- struts hibernate spring 环境配置时出现 HTTP Status 404 Servlet action is not available (解决方法)
- Servlet action is not available的问题
- OpenSessionInViewFilter在SSH框架中的应用
- Ant+Xdoclet配合生成hibernate相关文件
- C#中调用PB的DLL
- ssh集成过程中针对Servlet action is not available的解决办法
- select基础
- 用Spring集成Struts时老出Servlet action is not available
- 对吞吐量和吞吐率的理解
- 处理struts servlet jsp 中文乱码问题
- 最美妙的数学公式
- 说说大型高并发高负载网站的系统架构
- java传值还是传引用
- c语言中“→”符合代表什么?
- 获取request里的所有参数名及其参数值(参数名自动获取)
- java值传递与引用传递