I had a unique problem probably no one gets this. I am using Jsp for viewing and i had written a class which inherits SimpleFormController. i had overrided doSubmitAction method and processFormSubmission. my problem is in the jsp i had search button and link, by clicking on that link it will displays the desired result. and button ( final submit). The problem here is when i enter some text and press the link with the mouse i will get the result. but when enter the text and press Enter i will get an exception (NullPointerException). I had tried with every possibility and atlast came to the forums. can any body tell me how to disable the enter key. i mean when i press the enter no action needs to be taken.
Try just implementing doSubmitAction(). You don't need to implement processFormSubmission() when you are extending a SimpleFormController. Check out the workflow provided in the API doc, particularly number 4.
When you click on a link, that is an HTTP GET, which is calling whatever the link is pointing to. If it's a SimpleFormController, typically this will render the form. When you hit enter you are causing an HTTP POST, which when the submitting to a SimpleFormController will fire off the workflow that I linked to above. I suspect the problem therefore is that your overriding processFormSubmission() is short-circuiting this workflow and doSubmitAction() is never called. There could be other issues, but the gist of it is don't override processFormSubmission().
posted 12 years ago