0
<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 .

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
Danny me
  • 1
  • 1
  • 2
  • [Please see why we shouldn't post pictures of text (or links to pictures of text).](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question) – Dave Newton Nov 12 '21 at 13:36
  • Thank for remind using code instead of image but i tried to put the code many times , it always shows the incorrect format. – Danny me Nov 13 '21 at 08:05
  • It might be helpful to others if you show a screenshot or text of the error – cs94njw Nov 17 '21 at 17:15

1 Answers1

0

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.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
  • Thank for the respond . But is it still available for some struts 2.1 elements using id ? like form tags ? – Danny me Nov 13 '21 at 08:04
  • @Dannyme It's available on the tags that support it. The tag documentation lists the properties available for each tag. – Dave Newton Nov 14 '21 at 15:53