You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ryan Shelley <ry...@12gaugemedia.com> on 2007/08/13 20:34:04 UTC

Prefix Paths on Servlets

I developed a servlet with the package name "idm.war".  Therefore, my  
URL is http://myhost/idm/...

However, it's recently been requested that I add a prefix to my  
servlet.  Now it should be http://myhost/it/idm/...

Does tomcat provide a configuration that would allow me to add "/it"  
to just this servlet as a prefix, without having to repackage my war  
as "it.war" (my package is not all of IT's servlets, so I don't want  
to package it as such)?  I looked at the servlet context, and I don't  
believe that does what I need.  Any other suggestions?

Thanks!

-Ryan

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Prefix Paths on Servlets

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ryan Shelley [mailto:ryan@12gaugemedia.com] 
> Subject: Re: Prefix Paths on Servlets
> 
> So I've been able to deploy the servlet and access it with the "/it"  
> prefix, however, I noticed that when I redeploy my war, my custom  
> it#idm.war context file is also removed.

You can't use the manager app or any other conventional script I know of
to do deployment or redeployment.  (Remember, your .war file must be
placed outside of the normal webapps directory.)  All that's needed to
deploy the app is to copy the it#idm.xml file into conf/Catalina/[host]
- nothing else should be moved or updated.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Prefix Paths on Servlets

Posted by Ryan Shelley <ry...@12gaugemedia.com>.
My apologies, I replied to the wrong thread...

So I've been able to deploy the servlet and access it with the "/it"  
prefix, however, I noticed that when I redeploy my war, my custom  
it#idm.war context file is also removed.  Is there a way to keep that  
transient between deployments?  Or package it with the war?

On Aug 13, 2007, at 12:03 PM, Ryan Shelley wrote:

> My apologies... I'm on Tomcat 5.5.  I'll take a look at it and give  
> that a try.  Thanks Chuck!
>
> On Aug 13, 2007, at 11:59 AM, Caldarale, Charles R wrote:
>
>>> From: Ryan Shelley [mailto:ryan@12gaugemedia.com]
>>> Subject: Prefix Paths on Servlets
>>>
>>> However, it's recently been requested that I add a prefix to my
>>> servlet.  Now it should be http://myhost/it/idm/...
>>
>> Assuming you're running a reasonably modern version of Tomcat (you
>> didn't bother to tell us), then place your idm.war file somewhere  
>> other
>> than the <Host> appBase directory (usually webapps).  Then, create a
>> file in conf/Catalina/[host] named it#idm.xml containing a <Context>
>> element with a docBase attribute pointing to the location of the  
>> idm.war
>> file.
>>
>> As long as you haven't hard-coded the path in the html/jsp/java  
>> source,
>> you should be o.k.
>>
>>  - Chuck
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE  
>> PROPRIETARY
>> MATERIAL and is thus for use only by the intended recipient. If you
>> received this in error, please contact the sender and delete the e- 
>> mail
>> and its attachments from all computers.
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Prefix Paths on Servlets

Posted by Ryan Shelley <ry...@12gaugemedia.com>.
My apologies... I'm on Tomcat 5.5.  I'll take a look at it and give  
that a try.  Thanks Chuck!

On Aug 13, 2007, at 11:59 AM, Caldarale, Charles R wrote:

>> From: Ryan Shelley [mailto:ryan@12gaugemedia.com]
>> Subject: Prefix Paths on Servlets
>>
>> However, it's recently been requested that I add a prefix to my
>> servlet.  Now it should be http://myhost/it/idm/...
>
> Assuming you're running a reasonably modern version of Tomcat (you
> didn't bother to tell us), then place your idm.war file somewhere  
> other
> than the <Host> appBase directory (usually webapps).  Then, create a
> file in conf/Catalina/[host] named it#idm.xml containing a <Context>
> element with a docBase attribute pointing to the location of the  
> idm.war
> file.
>
> As long as you haven't hard-coded the path in the html/jsp/java  
> source,
> you should be o.k.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE  
> PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e- 
> mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Prefix Paths on Servlets

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ryan Shelley [mailto:ryan@12gaugemedia.com] 
> Subject: Prefix Paths on Servlets
> 
> However, it's recently been requested that I add a prefix to my  
> servlet.  Now it should be http://myhost/it/idm/...

Assuming you're running a reasonably modern version of Tomcat (you
didn't bother to tell us), then place your idm.war file somewhere other
than the <Host> appBase directory (usually webapps).  Then, create a
file in conf/Catalina/[host] named it#idm.xml containing a <Context>
element with a docBase attribute pointing to the location of the idm.war
file.

As long as you haven't hard-coded the path in the html/jsp/java source,
you should be o.k.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org