httprequest请求时序和spingMVC
来源:互联网 发布:mac系统常用软件下载 编辑:程序博客网 时间:2024/06/07 16:32
1. http://blog.sina.com.cn/s/blog_667ab8240101gfd6.html
职责链模式
对与多个匹配的Filter,哪个先执行呢?
JSR中说明的是,按照多个匹配的Filter,是按照其在web.xml中配置的顺序来执行的。
2. spingMVC
jsp--->filter--servlet(control)--->db
3. js到servlet
JSP传值给Servlet有几种形式:Form表单传值,url传值,其他方式传值
a、form表单传值:
JSP页面有:<input type="radio" name="staffdepartment" value="1" id="department1" />,将department的id传到Sevlet
中,在程序中如下:ServletRequest request;String staffdepartment=request.getParameter("staffdepartment");可获取jsp传的department,但要获取id还要进行转化:int int_staffdepartment=Integer.parseInt(staffdepartment);
b、url传值
比如这里的 <a>标签的 href属性与 <form>标签的 action属性的值 "JspServlet?action=toServlet",在 servlet同样用 request.getParameter("action")获取;
c、Java代码传值
java片段代码,servlet只能接到 session.setAttribute("testSession","Hello session")的内容,而接不到 request的内容。在 servlet里用 request.getSession().getAttribute("testSession")获取 session内容。
servlet返回js
具体实现如下:
java代码:String a= "abccdefg ";
request.setAttribute( "ValueA ",a);
request.getRequestDispatcher( "网址/jsp页面 ").forward(request,response);
jsp页面:
<%
String s =(String)request.getAttribute( "ValueA ");
%>
jsp页面就可以取出Servlet的值。
另外springMVC中还可以用
mv.setViewName("system/admin/login"); 返回jsp
ApplicationContext.xml/
<property name="unauthorizedUrl" value="/login_toLogin" />
---------------------------------------------------------------------------------------------------------------
ApplicationContext.xml中shiroFilter和web.xml中的关系
答:而 要在Spring中使用Shiro的话,可在web.xml中配置一个DelegatingFilterProxy,DelegatingFilterProxy作用是自动到Spring容器查找名字为shiroFilter(filter-name)的bean并把所有Filter的操作委托给它。
- httprequest请求时序和spingMVC
- HTTPRequest 网络请求之get请求和post请求
- spingmvc的请求流程
- linux cgi httprequest 请求
- HttpRequest请求接口
- httpRequest请求方法
- 浅谈sping和spingmvc
- HttpRequest(联网 http请求)
- java httpRequest协议请求分享
- HttpRequest和HttpWebRequest
- Servlet HttpRequest和HttpResponse
- HttpRequest和HttpResponse对象
- spingmvc处理request请求的方式
- magento的请求时序图和模块依赖图
- HttpRequest
- HttpRequest
- httprequest
- HttpRequest
- 图解SQL的各种连接join
- greenplum报错:Interconnect error writing an outgoing packet: Operation not permitted
- MyEclipse集成Maven及配置
- 如何读取STM32的唯一ID
- 构造函数
- httprequest请求时序和spingMVC
- 查看struts的所有action映射情况
- Tomcat启动异常org.springframework.beans.factory.BeanCreationException
- 速度无限大的概念
- SlidingMenu的使用
- eclipse中tomcat的add and remove找不到项目
- jquery的this与$(this)的区别
- escape,encodeURI,encodeURIComponent方法使用
- docker中宿主机与容器(container)互相拷贝传递文件的方法