You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Celson Lima <ce...@cstb.fr> on 2001/06/25 10:56:29 UTC

Servlet configuration

Hi there,
I'm beginner with TOMCAT, which means maybe my question is too simple for
you, but it is really "advanced" to me. I would like get help with the
following: I have Cocoon installed together with TOMCAT and it is working
perfectly. I would like to use cocoon to handle the presentation issues of
my site. However, I would like to have my own "servlet",which means, I
would like to use my own directory (let's say, /webapps/cpl ) instead of
having my things inside the Cocoon's directory (/webapps/cocoon). My
problem starts when I try do display a xml page (lets say
/cpl/prms/getparms.xml) that is placed within my directory.
I configured my "/cpl/web.xml" as shown below and I think because of that
the invocation of "/cpl/prms/getparms.xml" is not sent to Cocoon rather to
my servlet "/cpl". Is this correct and if it is, is there anything I can do
in order to send that call directly to Cocoon?
<servlet-mapping>
<servlet-name>cpl</servlet-name>
<url-pattern>/cpl</url-pattern>
</servlet-mapping>
Thank you in advance for your kind attention,
Celson


Re: Servlet configuration

Posted by Dmitri Colebatch <di...@nuix.com.au>.
Celson,

3 things:

1. inside the webapps/cpl directory create another called WEB-INF 
(case-sensitive) and inside that put the web.xml.  
2. also in the WEB-INF directory create a classes directory and put your 
servlet in there.  
3. in the web.xml you will need a servlet definition if you want to map it by 
name, eg:
<servlet>
  <servlet-name>cpl</servlet-name>
  <servlet-class>yourpackage.yourservlet</servlet-class>
</servlet>

hope this helps.

cheers
dim

On Mon, 25 Jun 2001 18:56, you wrote:
> Hi there,
> I'm beginner with TOMCAT, which means maybe my question is too simple for
> you, but it is really "advanced" to me. I would like get help with the
> following: I have Cocoon installed together with TOMCAT and it is working
> perfectly. I would like to use cocoon to handle the presentation issues of
> my site. However, I would like to have my own "servlet",which means, I
> would like to use my own directory (let's say, /webapps/cpl ) instead of
> having my things inside the Cocoon's directory (/webapps/cocoon). My
> problem starts when I try do display a xml page (lets say
> /cpl/prms/getparms.xml) that is placed within my directory.
> I configured my "/cpl/web.xml" as shown below and I think because of that
> the invocation of "/cpl/prms/getparms.xml" is not sent to Cocoon rather to
> my servlet "/cpl". Is this correct and if it is, is there anything I can do
> in order to send that call directly to Cocoon?
> <servlet-mapping>
> <servlet-name>cpl</servlet-name>
> <url-pattern>/cpl</url-pattern>
> </servlet-mapping>
> Thank you in advance for your kind attention,
> Celson

Re: Servlet configuration

Posted by Francis Callo <fr...@yahoo.com>.
--- Celson Lima <ce...@cstb.fr> wrote:
> Hi there,
> I'm beginner with TOMCAT, which means maybe my
> question is too simple for
> you, but it is really "advanced" to me. I would like
> get help with the
> following: I have Cocoon installed together with
> TOMCAT and it is working
> perfectly. I would like to use cocoon to handle the
> presentation issues of
> my site. However, I would like to have my own
> "servlet",which means, I
> would like to use my own directory (let's say,
> /webapps/cpl ) instead of
> having my things inside the Cocoon's directory
> (/webapps/cocoon). My
> problem starts when I try do display a xml page
> (lets say
> /cpl/prms/getparms.xml) that is placed within my
> directory.
> I configured my "/cpl/web.xml" as shown below and I
> think because of that
> the invocation of "/cpl/prms/getparms.xml" is not
> sent to Cocoon rather to
> my servlet "/cpl". Is this correct and if it is, is
> there anything I can do
> in order to send that call directly to Cocoon?
> <servlet-mapping>
> <servlet-name>cpl</servlet-name>
> <url-pattern>/cpl</url-pattern>
> </servlet-mapping>

it should be "<url-pattern>/cpl/*</url-pattern>" all
request would be passed to cpl when you say
http://somedomain.com/cpl/cpl/prms/getparms.xml

the "/prms/getparms.xml" will be passed to sevlet cpl
i havent tried this for a long time just give it a
try.

> Thank you in advance for your kind attention,
> Celson
> 


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/