Search code examples
eclipsejspstruts2struts-tags

Struts 2 optiontransferselect cannot use < symbol in addToLeftLabel attribute


I am trying to change the text of add to left button become <. What I have tried is

<s:optiontransferselect
    label="Favourite Cartoons Characters"
    name="leftSide"
    addToLeftLabel="&lt;"
    list="{'Master', 'Chief Officer', '2nd Officer'}"
    doubleName="rightSide"
    doubleList="{}"
/>                  

But instead of changing the button text to < it shows &lt; instead.

But when I did it like this

<s:optiontransferselect
    label="Favourite Cartoons Characters"
    name="leftSide"
    addToLeftLabel="<"
    list="{'Master', 'Chief Officer', '2nd Officer'}"
    doubleName="rightSide"
    doubleList="{}"
/>

It works fine but in Eclipse the code linter doesn't work anymore after the line where I used <

Is there anything that I can do to bring back the linting or use &lt; in the code?


Solution

  • You can use

    addToLeftLabel="<" 
    

    and it works well.

    Many IDEs have JSP editors that generate errors in JSP because they don't understand specific EL languages and always mistake to choose one that they want to use for their errors.