en en en

Why the jsp apply struts2 always display attribute id invalid for tag url according to TLD?

506 Views Asked by At
<s:url id = "indexEN" namespace="/" action = "locale" >
  <s:param name = "request_locale" >en</s:param>
</s:url>
    
<s:url var = "indexES" namespace="/" action = "locale" >
  <s:param name = "request_locale" >es</s:param>
</s:url>
        
<s:a href="%{indexEN}" >English</s:a>
      
<s:a href="%{indexES}" >Spanish</s:a>
      
<s:a href="%{indexFR}" >France</s:a>

PLease tell me the solution for this problem .Thank you .

1

There are 1 best solutions below

2
Dave Newton On

The solution is to not use an attribute that doesn't exist on the <s:url> tag.

As per the documentation:

NOTE: The id attribute is deprecated in Struts 2.1.x, and has been replaced by the var attribute.