servlet中API总结

来源:互联网 发布:淘宝小二介入后不满意 编辑:程序博客网 时间:2024/05/16 05:41

HttpServletRequest 中的方法:

1)getRequestURL() 得到请求完整的URL

2)getRequestURI() / getServletPath() 得到URI 即除ip:port后的一段

3)  getContextPath()    // **三者之间的关系需要进一步的探究

getContextPath() + getServletPath() = getRequestURI

上面两个API的关系就是   getRequestURL() = ip:port + "/" +  getRequestURI()或getServletPath()


http的状态码  302是重定向  404服务没有架起来  500是服务器内部的错误

httpServletResponse.sendRedirect(String path) 重定向功能,可以发送到当前服务外的URL。会设置状态码和location字段

getRequestDispatcher(String path).forward(request, response)  或  requestDispatcher.include(request, response) 服务器内部的重定向,对浏览器是透明的。


与单点登入有关的过滤器有:

org.jasig.cas.client.session.SingleSignOutFilter
org.jasig.cas.client.authentication.AuthenticationFilter
org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter



0 0
原创粉丝点击