• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception raises when i press Enter

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic