Struts2 - JSP EL - Concatenation doesn't seem to work

后端 未结 1 1090
小蘑菇
小蘑菇 2021-01-06 03:39

Trying to figure out this issue for a long time...

I am setting a variable with a value from an Object.

<         


        
相关标签:
1条回答
  • 2021-01-06 04:30

    The value attribute should be an object. OGNL uses quotes to delimit a string object, other quotes should be escaped.

    And use var attribute for variable name.

    <s:set var="bodyText" value="'First Name \"myObject.name\"'"/>
    <s:property value="bodyText" />
    
    0 讨论(0)
提交回复
热议问题