Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling servlet from JSP

 
hash eagle
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I use JBuilder. I declare a form like this in the JSP page:
<form method="post" action="/servlet">
<input type="submit" name="login" value="something">
</form>
the problem is everytime i click on the form, i always get this message:
Ctx( ): 400 R( /) null
Ctx( ): IOException in: R( /) Not connected: socket write error
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which web sever u r using? where r u keeping ur servlets and jsp files??
 
hash eagle
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i use tomcat in jbuilder5.. the path is correct.. but i dunno what's wrong
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<form method="post" action="/servlet">
does not give the name of a servlet class to execute!
Is that really the way your HTML form looks?
Bill
 
hash eagle
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<form method="post" action="/servlet/FileManServlet">
Originally posted by William Brogden:

<form method="post" action="/servlet">
does not give the name of a servlet class to execute!
Is that really the way your HTML form looks?
Bill

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a chapter on debugging servlets - available free at:
http://www.lanw.com/books/servletjsp/default.htm
The first thing to do is to find out if your servlet is even getting recognized and loaded by the servlet engine (Tomcat?) -
to do that put an output statement in the init() method - if that is not showing up then you have a naming problem.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic