I am using the simple theme to avoid table structure in my form. And when I use the Struts2 label tag in conjunction with a select tag linking the two by the key attribute , my label is changing when I set the select drop down in the form? The Form elements look like this:
When the page renders, the label tag is generated with the correct value of 'COUNTRY', but when I select a country value from the select drop down, and then submit the form, other form errors are thrown because of missing values - validation occurs properly - and then the label changes to the country selected?
I need the label to remain the same and not change to the selected drop down value?
Joined: Nov 22, 2011
The issue was the key name in the resource file, by qualifying it further by changing the key from country to label.country. So then in the JSP file, the label now looks like:
<s:label key="label.country" />
subject: Struts2 label tag - key attribute is being replaced with actual value?