Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Calling servlet from app Tomcat

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 localhost:8080//RequestInfoExample
I understood as the code while calling from the applet is some where wrong!!
can any one help in this regard,
Saloon Keeper
Posts: 22133
Android Eclipse IDE Tomcat Server Redhat Java 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.
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic