Struct2.1.*升级到2.5.13文档

Struct2.1-Struct2.5.10版本存在重要的安全漏洞,所以我们需要升级到2.5.13版本,

升级方法如下:

 

1.需要删除的jar包

2.需要增加的jar包

 

3.替换structs.xml

位置:config/structs.xml

修改内容:

a.  头部改为(这个是用来指定文件中允许使用那些标签

b. 关键地方 struts2.5 为了提升安全性,添加了 allomethod 标签

c.由于新版本的Struts默认不能修改action的访问后缀,不能使用通配的方式调用action里的方法,所以添加

使得<constant name="struts.action.extension" value="do" />可以生效

d. 

 注意这里添加了:strict-method-invocation="false"( action标签method属性开启)

 

4.替换web.xml

位置:WebContent/WEB-INFO/web.xml

修改内容:

<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>修改成

<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>”

 

原因:新版本的filter包前面没有ng包

 

 

5.在config目录下添加log4j2.xml

原因:

log4j 2.x版本不再支持像1.x中的.properties后缀的文件配置方式,2.x版本配置文件后缀名只能为".xml",".json"或者".jsn".所以我们把之前log4j.properties配置信息迁移到新的log4j2.xml中。

详细配置文件节点解析说明请参考:https://www.cnblogs.com/hafiz/p/6170702.html

6.在src\ICT\framework\web.struts2包下替换XssInterceptor.java

原因: 
Apache官方修改了invocation.getInvocationContext().getParameters();接口的实现,原来返回的是一个java.util.Map,现在返回了一个org.apache.struts2.dispatcher.HttpParameters类型的对象

 

 

 

注:页面提交表单的时候不要用struts自带的<s:form>和<s:form>的namespace属性,最好也别用$("#").submit()提交,会出现action无论返回success还是其它的,页面就是不不变,也不是404和500,页面就是不动。解决办法舍弃用<s:form>,直接用普通的<form></form>表单

转载于:https://my.oschina.net/u/3577079/blog/1581010

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
分析这个结构体具体分析这个结构体 具体解释这个结构体 struct dp_netdev_flow { const struct flow flow; /* Unmasked flow that created this entry. */ /* Hash table index by unmasked flow. */ const struct cmap_node node; /* In owning dp_netdev_pmd_thread's */ /* 'flow_table'. */ const struct cmap_node mark_node; /* In owning flow_mark's mark_to_flow */ const ovs_u128 ufid; /* Unique flow identifier. */ const ovs_u128 mega_ufid; /* Unique mega flow identifier. */ const unsigned pmd_id; /* The 'core_id' of pmd thread owning this */ /* flow. */ /* Number of references. * The classifier owns one reference. * Any thread trying to keep a rule from being freed should hold its own * reference. */ struct ovs_refcount ref_cnt; bool dead; uint32_t mark; /* Unique flow mark assigned to a flow */ /* Statistics. */ struct dp_netdev_flow_stats stats; /* Statistics and attributes received from the netdev offload provider. */ atomic_int netdev_flow_get_result; struct dp_netdev_flow_stats last_stats; struct dp_netdev_flow_attrs last_attrs; /* Actions. */ OVSRCU_TYPE(struct dp_netdev_actions *) actions; /* While processing a group of input packets, the datapath uses the next * member to store a pointer to the output batch for the flow. It is * reset after the batch has been sent out (See dp_netdev_queue_batches(), * packet_batch_per_flow_init() and packet_batch_per_flow_execute()). */ struct packet_batch_per_flow *batch; /* Packet classification. */ char *dp_extra_info; /* String to return in a flow dump/get. */ struct dpcls_rule cr; /* In owning dp_netdev's 'cls'. */ /* 'cr' must be the last member. */ };
最新发布
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值