0

To force OGNL evaluation one could use the %{} syntax, but what should be used to disable it?

Consider following code -

<s:a action="likeButton">
   <s:param name="returnAction" value="viewItem" />
</s:a>

What happens is that viewItem is looked up on the value stack and when it isn't found an empty string gets returned.

likeButton?returnAction=

This is not what I want. What I wanted was the literal value viewItem to be passed as a parameter.

likeButton?returnAction=viewItem
Kshitiz Sharma
  • 17,947
  • 26
  • 98
  • 169

1 Answers1

1

You should delimiter your literal with single quotes inside the double quotes and then it should be fine.

<s:a action="likeButton">    
    <s:param name="returnAction" value="'viewItem'" /> 
</s:a> 

Regards,

pedromarce
  • 5,651
  • 2
  • 27
  • 27