I'm new to struts. I'm using jquery datepicker plugin. I want to get a date(and time) from the user and insert it into the database. When i submit the form, the action class receives 0 value if i set the datatype to long(or int) and it receives null when i set datatype to anything else. I'm not sure what datatype should be used and how it is to be done. Please help
JSP form
<s:form name="register-complaint" action="registerComplaint" method="post">
:
:
<sj:datepicker id="date_time" name='date_and_time' label="Date and Time of Offence"
timepicker="true" timepickerAaPm="true" timepickerGridHour="1" timepickerGridMinute="5"
timepickerStepMinute="5"/>
:
:
</s:form>
Action class
private Date dateAndTimeOfOccurance;
// or long
public String execute throws Exception{
:
ps.setDate(13, (java.sql.Date) getDateAndTimeOfOccurance());
// or ps.setLong(13, getDateAndTimeOfOccurance());
:
}