I am using Struts2,
I have a Action with Properties, I have a property Person, with "date" property.
class Person{
Date birthDate;
//more properties
}
class MyAction implements ModelDriven<Person>{
Person person;
public String create(){
person = new Person();
}
public String save(){
MyPersistenceContext.save(person);
}
@Override
public PhysicalPerson getModel() {
return person;
}
}
<label class="col-sm-2 control-label">Birthdate</label>
<div class="col-sm-4">
<s:textfield name="birthDate" cssClass="form-control"></s:textfield>
<s:fielderror name="birthDate"
fieldName="birthDate"></s:fielderror>
</div>
When I call the "create" method the Input shows as MM/dd/yy(short format), and when I do submit of the form the date is readed as the same format by the Struts, but I want to manage the date with the format "dd-MM-yyyy"
I see the page
http://www.mkyong.com/struts2/how-to-configure-global-resource-bundle-in-struts-2/
But, I think that the Listener method is called before of the Filter, and does not work Well.
what is the best way to manage a Locale Global Properties with Struts???
What is the best way to setting a Locale by Http Session User.
regards.