简体   繁体   English

Struts Jquery 将 Struts 从 Struts 2.5.22 升级到 2.5.27 后出现网格负载问题

[英]Struts Jquery Grid load issue after upgrading Struts to 2.5.27 from Struts 2.5.22

Hi We have recently upgraded Struts2 from Struts 2.5.22 to 2.5.27.您好我们最近将 Struts2 从 Struts 2.5.22 升级到 2.5.27。 In our application we are are using Struts Jquery Grid.在我们的应用程序中,我们使用的是 Struts Jquery Grid。 We are using struts2-jquery-grid-plugin-4.0.3.jar library.我们正在使用 struts2-jquery-grid-plugin-4.0.3.jar 库。

One of our application need is to assign grid id a dynamic value which is bean property.我们的应用程序需要为网格 ID 分配一个动态值,即 bean 属性。 My code snippet is below:我的代码片段如下:

<sjg:grid id="%{#tabGrid.gridId}" caption="%{#tabGrid.gridCaption}" gridModel="%#tabGrid.gridData}" href="%{gridUrl}"-------->

Before upgrade above piece of code was working.在升级之前,上面的代码是有效的。 But after the upgarde we are unable to assign grid id bean property.But we can assign grid caption bean property like shown in above code snippet.Only when we are assigning id a bean property my code is breaking.但是在升级之后,我们无法分配网格 id bean 属性。但是我们可以分配网格标题 bean 属性,如上面的代码片段所示。只有当我们分配 id bean 属性时,我的代码才会中断。

I have tried to workaround by assigning grid class value of property bean than id.我试图通过分配属性bean的网格class值而不是id来解决这个问题。 But this change will impact lot of code changes in my application.但是这种更改会影响我的应用程序中的大量代码更改。 Please suggest what could be the reason for it and possible solution.请提出可能的原因和可能的解决方案。

Since Struts 2.5.26 you no longer can use %{} to force OGNL evaluation in the Struts tags using public attributes which leads to double evaluation of OGNL expression.从 Struts 2.5.26 开始,您不再可以使用%{}来强制使用公共属性在 Struts 标记中进行 OGNL 评估,这会导致 OGNL 表达式的双重评估。 This fixture is documented in S2-061 .此夹具记录在S2-061中。

Some of the tag's attributes could perform a double evaluation if a developer applied forced OGNL evaluation by using the %{...} syntax.如果开发人员通过使用%{...}语法应用强制 OGNL 评估,则标签的某些属性可能会执行双重评估。 Using forced OGNL evaluation on untrusted user input can lead to a Remote Code Execution and security degradation.对不受信任的用户输入使用强制 OGNL 评估可能会导致远程代码执行和安全性下降。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM