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
http://localhost/servlet/UserLogin
(servlet-name)
Johan
|
- Servlets Jens Frank
- Johan Fredriksson