struts2
文章平均质量分 66
wnczwl369
这个作者很懒,什么都没留下…
展开
-
struts2 token 防止重复提交原理
原理: 服务器端在处理客户端的请求之前,会将请求中包含的令牌值与保存在当前会话中的令牌值进行比较,看是否匹配。在处理完该请求后,并且在信息达到客户端之前,将产生一个新的令牌。该令牌值将会替换当前会话中的令牌值,并且传到客户端。这样如果用户回退到刚才的提交页面并再一次提交的话,客户端传过来的令牌与服务其中的令牌值不一致,从而有效的防止了提交 转自:tonger http://blog.sina.转载 2012-04-19 17:12:41 · 1004 阅读 · 0 评论 -
struts2文件下载及 <param name="inputName">inputStream</param>的理解
struts.xml文件配置: <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">原创 2012-04-21 00:47:54 · 18782 阅读 · 8 评论 -
struts2文件上传中action类中File类型的属性剖析
一般情况下处理下载的action类中需要有如下属性: private File attachment; private String attachmentFileName; private String attachmentContentType;其中attachment是任意的,但是其他两个属性中FileName及ContentTye是固定的,这是由struts2的源码决定的。 下面原创 2012-04-23 14:01:45 · 2685 阅读 · 0 评论 -
由自定义的拦截器窥探struts2 Interceptor拦截器拦截机制
示例如下: Action类:TestAction.java package action; import com.opensymphony.xwork2.ActionSupport; public class TestAction extends ActionSupport { private String name; public String getName() {原创 2012-05-08 18:14:53 · 1097 阅读 · 0 评论 -
HTTP Status 404 - No result defined for action EmployeeAction and result input - action类似异常解决及原因剖析
根据提示在struts.xml相应位置处加上了返回类型为input的,蓝色部分,就好了,其实这种解决方法治标不治本。 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2原创 2012-04-21 18:12:13 · 1348 阅读 · 1 评论 -
HTTP Status 404 - No result defined for action EmployeeAction and result input - struts2类似异常解决及原因剖析
根据提示在struts.xml相应位置处加上了返回类型为input的,蓝色部分,就好了,其实这种解决方法治标不治本。 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2原创 2012-05-13 18:01:45 · 5023 阅读 · 2 评论