tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Seidl" <smse...@worldnet.att.net>
Subject RE: Servlet / Tomcat question
Date Fri, 07 Jun 2002 04:02:52 GMT
Thanks for the help, but I'm still having problems.

The package of the servlet I'm trying to access is ltshoppingcart and
the servlet name is Login.  So I have tried accessing the servlet by
going to http://localhost:8080/lt2001/servlet/ltshoppingcart.Login and
all I get is a message from Tomcat saying that the requested resource is
unavailable.

Any ideas?

Thanks

-----Original Message-----
From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com] 
Sent: Thursday, June 06, 2002 8:39 AM
To: Tomcat Users List
Subject: RE: Servlet / Tomcat question

Howdy,
If your web-application is called MyApp, and your servlet class is
com.mycompany.myclass, you'd access it as
http://myserver.mydomain:myport/MyApp/servlet/com.mycompany.myclass

If you deployed to the ROOT web app, so that your context is the root
context, you would remove the /MyApp/ part from the above URL.

If you have a web.xml file (a Deployment Descriptor is a good thing to
have -- it'll become a good friend of yours ;)), you can alias the
servlet like

<servlet>
  <servlet-name>MyServlet</servlet-name>
  <servlet-class>com.mycompany.myclass</servlet-class>
</servlet>
<servlet-mapping>
  <servlet-name>MyServlet</servlet-name>
  <url-pattern>/MyServlet</url-pattern>
</servlet-mapping

And then you could access it as
http://myserver.mydomain:myport/MyApp/MyServlet

See the Servlet Spec (v2.3 if you're using tomcat v4.x) for what goes in
the Deployment Descriptor etc.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Scott Seidl [mailto:smseidl@worldnet.att.net]
>Sent: Wednesday, June 05, 2002 9:19 PM
>To: tomcat-user@jakarta.apache.org
>Subject: Servlet / Tomcat question
>
>I'm stumped.  I have a web application (term used loosely) which was
>created using Borland's JBuilder.  The servlets in this application
>worked fine when I ran them in JBuilder and accessed them locally.  I
>now want to place them on an Apache Tomcat web server.  I can compile
>and deploy the code using ant and Tomcats manager (which also show that
>the web-app is running).  The problem I have is that I don't know how
to
>correctly call these servlets from the html.  With JBuilder we called
>them with the following type of command:
>http://localhost:8080/servlet/ltshoppingcart.cart.
>
>Can someone give me some idea on how to call these servlets with
tomcat?
>I do not have a web.xml file within my WEB-INF.  I do not quite
>understand the role of this file, and how to configure it.  Any help
>with either of these topics is welcome :-).
>
>Thanks
>Scot

--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message