IntelliJ Java IDE
The moose likes Struts and the fly likes How to disable type conversion error in Struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "How to disable type conversion error in Struts 2" Watch "How to disable type conversion error in Struts 2" New topic
Author

How to disable type conversion error in Struts 2

Aravind Ramanujam
Greenhorn

Joined: Dec 14, 2004
Posts: 15
I have a text field in my form for start date. The data type in my action for that field is date. I have custom validation for that date field in my validate method. When ever i have an invalid date keyed in that field, i'm getting 2 errors.

1 from the Struts 2 type conversion interceptor (i guess) "Invalid field value for field startDate".
2 from my custom validation from the validate method "Start Date required". The reason why i'm getting this is because i believe Struts 2 automatically clears the data if it is invalid and when the code reaches the validate method, the field has no value.

I would like to disable the type conversion error checks so that only one message is shown to the user.

Any help is appreciated.
 
 
subject: How to disable type conversion error in Struts 2
 
Threads others viewed
Advice for Struts forms with validation
new to struts
struts2 date conversion question
Struts 2 repopulate field when a conversion error happens without using validation.xml
how to use java.sql.Date type property in ActionForm??
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture