Search code examples
javajspstruts2strutsognl

How can we append 2 strings in Struts


I need to append 2 String class variables using Struts 2

I tried like this

<s:set var="Name" value="#variable1+#variable2"/>

but no result.


Solution

  • Use OGNL to force evaluation of concatenation operation

    <s:set var="Name" value="%{#variable1 + #variable2}"/>