aspose file tools*
The moose likes Servlets and the fly likes Servlet not Found problem! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet not Found problem!" Watch "Servlet not Found problem!" New topic
Author

Servlet not Found problem!

sabbir kazi
Ranch Hand

Joined: Feb 03, 2001
Posts: 62
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

Joined: Jan 29, 2001
Posts: 120
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


SCJO, SCJD, SCWCD, I-Net+, A+, Network+, MCSD, MCDBA, MCP, MCT
sabbir kazi
Ranch Hand

Joined: Feb 03, 2001
Posts: 62
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

Joined: Feb 03, 2001
Posts: 62
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet not Found problem!