This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Exception raises when i press Enter

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

thanks and regards,
Ramesh
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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().
 
Ramesh Etta
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jason for your reply.
I got the solution. the problem here is with one of my javascript methods.
i had written a method when ever a new submission happens this mehtod is getting called and bcz of that its getting the null pointer exception.

i thank very much for your reply.
    Bookmark Topic Watch Topic
  • New Topic