• Post Reply Bookmark Topic Watch Topic
  • New Topic

ServletException

 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • 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:

 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!