• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling servlet from app Tomcat

uday bhaskar
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to the tomcat.I would like to call the servlet in applet
using tomcat. for that i am using web.xml following are the details but i am not able to call the servlet. can any one help on this.
In applet, i am calling with the following method,
public Object getConnection()
Hashtable htPutLoginData = new Hashtable(1,1);
urlcheck = new URL(getCodeBase(),"RequestInfoExample");
LoginMessage msg = new LoginMessage(urlcheck);
InputStream in = msg.sendPostMessage(htPutLoginData);
ObjectInputStream result = new ObjectInputStream(in);
}catch(Exception e){System.out.println("Error at" + e.toString());}
My Web.xml page looks like this,
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

This servlet is placed with the following hirerchy
Jakarta tomcat4.0/webapp/test/Web-Inf/classes
where test is the root
since this class is not package, even i placed the class under root and tried. I mean in the directory
when i call from the applet, it shows the Error message as
Error atjava.io.FileNotFoundException: localhost:8080//RequestInfoExample
I understood as the code while calling from the applet is some where wrong!!
can any one help in this regard,
Tim Holloway
Posts: 18471
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you have a slash in front of your class name in the servlet-class tag?
You should place the file RequestInfoExample.class in your WEB-INF/classes directory for it to be properly found.
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!