tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thébault, Médérick" <Mederick.Theba...@brittany-ferries.fr>
Subject RE: Tomcat and servlet
Date Tue, 11 Jun 2002 14:41:53 GMT
Well It is working fine.

Thanx Jean-Luc. U could have answered "RTFM" as well.

Anyway, UR advice was a good one. All reside in web.xml.

First description of the servlet, then the URL and mapping data.

And the servlet is reachable by localhost/WebAppPrefix/servletname.
Tricky isn't it?

Thanx a lot.

Last thing is it possible to define more than one mapping for one
servlet?

I tried this :

<servlet-mapping>
  <servlet-name>MyServlet</servlet-name>
  <url-pattern>/zzz</url-pattern>
  <url-pattern>/MyApp</url-pattern>
</servlet-mapping>

and that

<servlet-mapping>
  <servlet-name>MyServlet</servlet-name>
  <url-pattern>/zzz</url-pattern>
  <servlet-name>MyServlet</servlet-name>
  <url-pattern>/MyApp</url-pattern>
</servlet-mapping>

But...

Also for newbie like me, www.moreservlets.com is a must for tips. Thanx
Tomas.

Read U soon,

Med


-----Message d'origine-----
De : Jean-Luc BEAUDET [mailto:beaudet@toolchest.cyber.kodak.com]
Envoyé : mardi 11 juin 2002 11:35
À : Tomcat Users List
Objet : Re: Tomcat and servlet


"Thébault, Médérick" a écrit :

> Thanx for the answers, It helps the debate but...
>
> I already deployed my servlet as mentionned in the documentation
> (servlet path is webapps/myservlet to act as in webapps/examples).
> Web.xml is quite simple as nothing is set in it. See below :
>
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>     "http://java.sun.com/dtd/web-app_2_3.dtd">
> <web-app>
> </web-app>
>
> But I still need to enter localhost/mypath/servlet/myservlet to access
> it.
>
> So Jean-Luc, I think I do not need to try your advice or am I
completly
> wrong and missing something essential?
>
> And Markus, what do you mean by ROOT context? Setting ROOT in
> conf/server.xml as /mypath/servlet will solve the case?
>
> Thanx in advance,
>
> Cheers.
>
> Med
>
> -----Message d'origine-----
> De : Jean-Luc BEAUDET [mailto:beaudet@toolchest.cyber.kodak.com]
> Envoyé : mardi 11 juin 2002 10:48
> À : Tomcat Users List
> Objet : Re: Tomcat and servlet
>
> "Marek, Tomas" a écrit :
>
> > Could give more details, please.
> >
> > tom
> >
> > -----Original Message-----
> > From: Markus Kirsten [mailto:markus.kirsten@iped.vxu.se]
> > Sent: Tuesday, June 11, 2002 10:36 AM
> > To: Tomcat Users List
> > Subject: Re: Tomcat and servlet
> >
> > Hi Med,
> > Deploy your servlet in the ROOT context instead.
> >
> > Markus
> >
> > On tisdag, juni 11, 2002, at 10:08 , Thébault, Médérick wrote:
> >
> > > Hi again,
> > >
> > > I would like to change the URL of my servlet.
> > >
> > > It can be access thru "http://localhost/servlet/MyServlet" but I
> would
> > > like to avoid "servlet" part.
> > >
> > > In every example that I saw, the "servlet" part was always in. Is
> there
> > > a way to set up something like alias?
> > >
> > > Thanx
> > >
> > > Med
> > >
> > > --
> > > 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>
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
>
> Well,
>
> The other way is to simply Deploy your own servlet zone and add a
> Your_Zone/WEB-INF/web.xml
> to bypass the default web.xml responsible of this mapping...
>
> Hope this help.
>
> Jean-Luc :O)
>
> --
> 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>

Well...

As your web.xml is empty, no new directives can bypass the default
one...

Try to add smth like:

../..

<servlet>
    <servlet-name>MyServlet</servlet-name>
    <servlet-class>MyServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>MyServlet</servlet-name>
    <url-pattern>/MyServlet</url-pattern>
</servlet-mapping>

../..

This could do the trick. I think that all of this would be described in
the
servlet API 2.3.

Hope this help.

Jean-Luc :O)





--
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