File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet not Found problem!

 
sabbir kazi
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using TomCat 3.2.1 as my servlet engine. I have created my own app folder on Tomcat and put my own servlets on the servlet ("/classes") directory. I have no problem with activating my servlets from my applets. But recently, I have developed another servlet which can't be found by the Applet while TomCat console shows the following error:
400 R( /WILEDS + /servlet/StudentMonitor + null) HTTP GET is not supported by this URL
My Applet code snippet is :
try
{
// Connect to the servlet
URL studentServlet = new URL("http://pc36777-0/WILEDS/servlet/StudentMonitor");

URLConnection studentServCon = studentServlet.openConnection();
} catch(Exception e) {

System.out.println(e.toString());

}
Anyway, the 'StudentMonitor' servlet class file is in the right directory under TomCat.
Any help will be highly appreciated.
Sabbir
 
Ray Smilgius
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you have a doGet() method in your servlet
\
Hope this helps
------------------
Sun Certified Java Programmer
Sun Certified Java Developer
I-Net Certified
A+ Certified
Network+ Certified
MCP
 
sabbir kazi
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ray. After adding the following,
protected void doGet(Http.. req, Http... res) {
try {
doPost(req, res);
} catch(IOException ioe) {
}
}
it works, but got nullPointerError when the doPost method tries to execute
seleStmt.clearParameters();
where seleStmt is a preparedStatement.
Any further help will be highly appreciated again.
Sabbir
 
sabbir kazi
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I have figured out the cause for the NullPointerException in my Stmt.clearParameters() statement. I didnot use any parameter in my queryString.
Thanks Ray again.
Sabbir
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic