I dont understand how Struts2 handle this basic problem, didnt find a conclusive answer
Example:- I have
- 1 simple Action CustomerAction.java ,
- CustmerAction.properties contains label key/values for username/password
- Customer.jsp with two textfield fields username/password,
- CustomerAction-Validation.xml , having a simple validation
Now if i give URI as
http://somserver/CustomerAction.action , immediately validator framework is invoked and i see my page loading with 2 errors.. Instead i want my page to load first clean without invoking at Validator, so i create another action say DummyAction1, which redirects to Customer.jsp ... But Customer.jsp is fetching labels using <s:text ... > which are defined in CustomerAction.properties , and which is not invoked yet.. So i have to duplicate my same label keys in DummyAction1.properties and CustomerAction.properties.
Is this kind of duplication approach common in Struts2? How to get rid of? It is creating problem for every form, 1 for initial display, 1 after validation.. Is defining global properties only solution? I dont understand the use of Actionname.properties at first place, what Struts2 is trying to achieve when we have to duplicate keys in 2 different actions???Or i may be missing avery basic concept...correct me..