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

Servlet not Found problem!

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic