struts2 - beans properties and modelDriven in struts 2 -


I'm new to the struts 2. I have a class action made the bean data from JSP page ModelDriven Interface

The problem is that I have some non 'string properties such as long , date in the bean ... etc. The problem is: when I jsp Pressing on the submit button in the page, I get an error saying that string setter was not found for that particular asset. For example, if I have my bean then

  Package com.hsms.aseza.entering Apiprovl class would do Approvl private on approval date of Krenprapti date () {Return employeeId; } Zero SetApploded Date (Date Employee ID) {this.employeeId = employeeId; }   

When driven model is implemented to-action class executes, it is a runtime exception runs

  java.lang .NoSuchMethodException: com.hsms.aseza.enteringApproval.EnteringApproval.setApprovalDate ([Ljava.lang.String;)   

is there any written to me date property?

I think your problem is conversion i.e. your conversion from conversion java.util.Date The object is expanded which is responsible for converting strings from other types like long, double etc. If you check the source code for you, you can either go to java.util.Date or java.sql.Date . So I think what you should do is write the converter for acceptance date . I will guide you on this process, you just need to edit the code to meet your needs. The

For example, to convert the convertFromString method of your converter and display your date in your JSP with the return of their conversion Is used for. java.util.Date or java.sql.Date .

Let me know if you have a problem applying it.

Comments