![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
struts
without0815
这个作者很懒,什么都没留下…
展开
-
struts 流程
1.服务器启动后,根据web.xml加载ActionServlet读取struts-config.xml文件内容到内存。 以登录为例:第一次进login.jsp会先实例化Form、把默认值(String默认为空字符串,整形默认为0)赋给表单元素。 输入用户名密码提交表单、提交到action属性的login.action,通过ActionServlet读struts-co原创 2012-05-18 10:39:20 · 533 阅读 · 0 评论 -
struts2原理图
一个请求在Struts2框架中的处理大概分为以下几个步骤 1 客户端初始化一个指向Servlet容器(例如Tomcat)的请求 2 这个请求经过一系列的过滤器(Filter)(这些过滤器中有一个叫做ActionContextCleanUp的可选过滤器,这个过滤器对于Struts2和其他框架的集成很有帮助,例如:SiteMesh Plugin) 3 接着FilterDispatcher被调原创 2012-05-20 13:09:04 · 1122 阅读 · 0 评论 -
Configuration reference
Add a constant element to your struts config file to change the value of a configuration setting, like: "struts.convention.result.path" value="/WEB-INF/mytemplates/"/> Name Default Va原创 2012-05-24 14:01:54 · 1126 阅读 · 0 评论 -
spring和struts整合
1.添加struts2包 2.在web.xml配置struts2过滤器 struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter struts2 /* 3.编写struts.xml,写测试应用程序确保验证struts配置正确 login.jsp原创 2012-06-25 14:13:17 · 835 阅读 · 0 评论 -
struts2让一个类成为 action的3种方式
第一种:让此类实现com.opensymphony.xwork2.Action接口。 第二种:让此类继承实现了com.opensymphony.xwork2.Action接口的类。 第三种:直接写类,不需要继承任何类,也不需要实现任何接口,但在Struts.xml文件中的节点中配置Method属性来指明一个执行方法,并且此类必须实现这个指明的方法。原创 2012-07-01 10:56:02 · 785 阅读 · 0 评论 -
action 3种得到 jsp中值
1.通过一个vo类封装属性,html 中name用vo.属性,action中直接vo取值(通过设置属性,getObject取值) 2.String uname=ServletActionContext.getRequest().getParameter("uname"); 得到request 3.实现一个ServletRequestAware这个接口原创 2012-07-02 14:46:50 · 677 阅读 · 0 评论 -
struts 零配置 convention-plugin
1.lib 加struts 默认包 ognl-2.6.11.jar struts2-core-2.1.6.jar xwork-2.1.2.jar freemarker-2.3.13.jar commons-fileupload-1.2.1.jar commons-io-1.3.2.jar commons-logging-1.0.4.jar 2.web.xml加struts拦原创 2012-05-24 16:29:33 · 966 阅读 · 0 评论