After revising my code, I reduced the maximum OGNL expression length to 30, 
since the longest expression remaining in my code is 28 characters.

    <constant name="struts.ognl.expressionMaxLength" value="30" />

This, however, triggers another exception:

[ERROR] 2022-04-02 14:34:51 [https-jsse-nio-8443-exec-9] OgnlValueStack - Could 
not evaluate this expression due to security constraints: 
[#attr['s2b_form_element_class’]]

Evidently there are some automatically generated OGNL expressions with length 
longer than 30. What’s a reasonable minimum expression length that will 
accommodate these?

Thanks,
Ralph



> On Mar 30, 2022, at 2:17 AM, Lukasz Lenart <lukaszlen...@apache.org> wrote:
> 
> wt., 29 mar 2022 o 17:14 Ralph Grove <rfgr...@icloud.com.invalid> napisał(a):
>> 
>> I found the problem - I had neglected to include the leading spaces of the 
>> continuation line when calculating the expression length. They were 
>> converted to tabs in my editor, which made the expression shorter. Putting 
>> the expression on a single line eliminates the exception.
>> 
>> Original source:
>>                                        <s:if test="%{participant.checklist 
>> <= 2
>>                                              || participant.surveyResponse 
>> == null}”>
>> 
>> Corrected:
>>                                        <s:if test="%{participant.checklist 
>> <= 2 || participant.surveyResponse == null}">
> 
> Ok, I was suspecting so after inspecting the stack trace. Anyway I
> would put such logic in the action or model, like this:
> 
> JSP:
> <s:if test="%{participant.noSurveyResponse}">
> 
> Java class:
> public class Participant {
>  ...
>  public boolean isNoSurveyResponse() {
>    return checklist <= 2 || surveyResponse == null;
>  }
> }
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to