• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

ServletException

 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone please help with this problem.
I have a search field in a JSP page. when the submit button is pressed the servlet responds appropriately. However if 'Enter" is pressed with caret in search field, I get "javax.servlet.ServletException"

this is the complete report:

 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hopenet.PatientServlet.doGet(PatientServlet.java:73)

Well, your Servlet is getting called. My guess is that it is a deploym,ent issue: you haven't included all of the classes and libraries required at runtime.
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

My guess is that it is a deploym,ent issue: you haven't included all of the classes and libraries required at runtime.



The thing is, if that were the case, then the servlet wouldn't run when i click on the submit button with the mouse. But it does run!

In other words the exception is only being thrown when i use the "Enter" button on the keyboard.

I'm sure there must be some really simple explanation for this behaviour, but right now i'm totally stumped
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well what is on line 73? You're probably going to need to provide more information for us, like the HTML page and srevlet listing, or atleast parts of them.
 
Marshal
Posts: 28295
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the stack trace you can see that line 73 is calling a method called "forward". Perhaps Kwame is trying to forward to a URL that is blank, or something like that. Investigating the URL would be what I would do next.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible for you to post your servlet code? It would be helpful.
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys. This is the servlet code:




...and this is the block of html from the jsp page



recall that this all works perfectly when the "Find" button is clicked with mouse, but not when "Enter" is pressed on keyboard!!!

i noticed something. when "Enter" is pressed, the URL dosen't containt the name of the "Find" button, which is "search", but this is included in the url when the button is explicitly clicked on!?
[ March 19, 2006: Message edited by: kwame Iwegbue ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If 'search' is null then 'address' doesn't get set. This could be caused by (for instance) having two forms and having the enter key submitting the other form.
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much David!!!

I simply wasn't handling the case where "search" is null.

I know this is not strictly a servlet question, but how then do i make the button send its name to the servlet?
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic