问题
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.
回答1:
Use OGNL to force evaluation of concatenation operation
<s:set var="Name" value="%{#variable1 + #variable2}"/>
回答2:
it is also working.
<s:set var="Name" value="#variable1+''+#variable2"/>
来源:https://stackoverflow.com/questions/23789198/how-can-we-append-2-strings-in-struts