Compile it and put the java/class files in /web-inf/classes
 
then access it as
 
 
(or if you put it in your default webb app the url is http://<hostname>/servlet/my.package.name.ClassName )
 
So if your SimpleServlet resides in a default package on your localmachine and in the default app the url would be
 
 
 
as for editing web.xml it is easy. XML is textbased.
 
 
just add a block like the following :
<servlet>
  <servlet-name>UserLogin</servlet-name>
  <display-name>UserLogin</display-name>
  <servlet-class>my.very.long.packagename.UserLoginServlet</servlet-class>
  <load-on-startup>2</load-on-startup>
 </servlet>
 
and of course change all values.
 
The nice thing about web.xml is that it lets you alias your servlets.
 
In the above example the url would be
 
 
Johan
----- Original Message -----
From: Jens Frank
Sent: Tuesday, July 24, 2001 9:37 PM
Subject: Servlets

Hello, I am newbie on this. I have a schoolaccount on a computer running Orion-server. I want to try out a clean java servlet, no JSP or anything else.. On my account there is a folder called WEB-INF and that folder contains 2 folders. classes and lib. In WEB-INF there also is a file called web.xml. What do I have to do to be able to run my servlet called SimpleServlet? Someone told me to change web.xml but I do not how to handle xml. Also, where should my servlet-file go? Should I complie it and send the .class file or send the .java file? Where should I put it? In the classes folder?
 
Many thanx for answears......
 
 
Best Regards, Jens Frank

Reply via email to