You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by banto <ba...@gmail.com> on 2010/04/20 12:54:07 UTC

standardize the URL

Hi,

i know this can be a silly question but i have the following issue:

i want to call my web app with a standard URL as http://host:port/myString

regardless from the path of the servlet under Tomcat tree. I have made some
try in web.xml url-pattern field but no success. Any advice?

thanks.
-- 
View this message in context: http://old.nabble.com/standardize-the-URL-tp28287836p28287836.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: standardize the URL

Posted by banto <ba...@gmail.com>.


Pid * wrote:
> 
> On 22/04/2010 11:27, banto wrote:
>> 
>> 
>> 
>> Pid * wrote:
>>>
>>> On 22/04/2010 10:10, banto wrote:
>>>>
>>>>
>>>>
>>>> Pid * wrote:
>>>>>
>>>>> On 22/04/2010 07:45, banto wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> Gregor Schneider wrote:
>>>>>>>
>>>>>>> On Tue, Apr 20, 2010 at 12:54 PM, banto <ba...@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> i know this can be a silly question but i have the following issue:
>>>>>>>>
>>>>>>>> i want to call my web app with a standard URL as
>>>>>>>> http://host:port/myString
>>>>>>>>
>>>>>>>
>>>>>>> how does the url look like when you call your webb-app currently?
>>>>>>>
>>>>>>> how would you like the url to look like?
>>>>>>>
>>>>>>> rgds
>>>>>>>
>>>>>>> gregor
>>>>>>> -- 
>>>>>>> just because you're paranoid, don't mean they're not after you...
>>>>>>> gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
>>>>>>> gpgp-key available
>>>>>>> @ http://pgpkeys.pca.dfn.de:11371
>>>>>>> @ http://pgp.mit.edu:11371/
>>>>>>> skype:rc46fi
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> I explain better my problem,
>>>>>>
>>>>>> my webapp is in the folder:
>>>>>>
>>>>>> C:\Program Files\Apache Software Foundation\Tomcat
>>>>>> 5.5\webapps\istanceVar
>>>>>>
>>>>>> and i call it with
>>>>>>
>>>>>> http://localhost:8080/instanceVar/instance
>>>>>>
>>>>>> what i would like to do (also for others webapps) is to call it/them
>>>>>> as
>>>>>>
>>>>>> http://localhost:8080/instance
>>>>>> http://localhost:8080/webapp_2
>>>>>> http://localhost:8080/webapp_3
>>>>>
>>>>> Rename the webapp, from "instanceVar" to "ROOT".
>>>>>
>>>>>> or better
>>>>>>
>>>>>> http://localhost/instance
>>>>>> http://localhost/webapp_2
>>>>>> http://localhost/webapp_3
>>>>>
>>>>> Change the port in the Connector from 8080 to 80.
>>>>>
>>>>>> how can i get the 2 modes?
>>>>>
>>>>> Then add multiple mappings for each instance of the URL.
>>>>>
>>>>>
>>>>> OR
>>>>>
>>>>> Create the servlet and map it to a value also present in the
>>>>> welcome-file list of file names.
>>>>>
>>>>>  http://localhost/instanceVar
>>>>>  http://localhost/webapp_2
>>>>>
>>>>>
>>>>> p
>>>>
>>>> thank you g now it works.
>>>>
>>>> However i understand the only way to do that is putting the webapps in
>>>> the
>>>> ROOT folder,right?
>>>
>>> If by webapp, you mean "Servlet".
>>>
>>> ROOT is a webapp in it's own right, it is not the same as the root
>>> directory of an HTTPD server.
>>>
>>> any .war file or directory (effectively an exploded .war file) you put
>>> in tomcat/webapps will be treated as an application.
>>>
>>>
>>> p>
>> Just to understand you:
>> 
>> i have copied the class files of my webapp and modified the relative
>> web.xml
>> to the folder
>> 
>> C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT
>> 
>> i hope you mean the same ROOT?
> 
> 
> Yes, this is correct.
> 
> 
> p
> 
> 
>  
> 


thank you!!
-- 
View this message in context: http://old.nabble.com/standardize-the-URL-tp28287836p28327291.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: standardize the URL

Posted by Pid <pi...@pidster.com>.
On 22/04/2010 11:27, banto wrote:
> 
> 
> 
> Pid * wrote:
>>
>> On 22/04/2010 10:10, banto wrote:
>>>
>>>
>>>
>>> Pid * wrote:
>>>>
>>>> On 22/04/2010 07:45, banto wrote:
>>>>>
>>>>>
>>>>>
>>>>> Gregor Schneider wrote:
>>>>>>
>>>>>> On Tue, Apr 20, 2010 at 12:54 PM, banto <ba...@gmail.com> wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> i know this can be a silly question but i have the following issue:
>>>>>>>
>>>>>>> i want to call my web app with a standard URL as
>>>>>>> http://host:port/myString
>>>>>>>
>>>>>>
>>>>>> how does the url look like when you call your webb-app currently?
>>>>>>
>>>>>> how would you like the url to look like?
>>>>>>
>>>>>> rgds
>>>>>>
>>>>>> gregor
>>>>>> -- 
>>>>>> just because you're paranoid, don't mean they're not after you...
>>>>>> gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
>>>>>> gpgp-key available
>>>>>> @ http://pgpkeys.pca.dfn.de:11371
>>>>>> @ http://pgp.mit.edu:11371/
>>>>>> skype:rc46fi
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> I explain better my problem,
>>>>>
>>>>> my webapp is in the folder:
>>>>>
>>>>> C:\Program Files\Apache Software Foundation\Tomcat
>>>>> 5.5\webapps\istanceVar
>>>>>
>>>>> and i call it with
>>>>>
>>>>> http://localhost:8080/instanceVar/instance
>>>>>
>>>>> what i would like to do (also for others webapps) is to call it/them as
>>>>>
>>>>> http://localhost:8080/instance
>>>>> http://localhost:8080/webapp_2
>>>>> http://localhost:8080/webapp_3
>>>>
>>>> Rename the webapp, from "instanceVar" to "ROOT".
>>>>
>>>>> or better
>>>>>
>>>>> http://localhost/instance
>>>>> http://localhost/webapp_2
>>>>> http://localhost/webapp_3
>>>>
>>>> Change the port in the Connector from 8080 to 80.
>>>>
>>>>> how can i get the 2 modes?
>>>>
>>>> Then add multiple mappings for each instance of the URL.
>>>>
>>>>
>>>> OR
>>>>
>>>> Create the servlet and map it to a value also present in the
>>>> welcome-file list of file names.
>>>>
>>>>  http://localhost/instanceVar
>>>>  http://localhost/webapp_2
>>>>
>>>>
>>>> p
>>>
>>> thank you g now it works.
>>>
>>> However i understand the only way to do that is putting the webapps in
>>> the
>>> ROOT folder,right?
>>
>> If by webapp, you mean "Servlet".
>>
>> ROOT is a webapp in it's own right, it is not the same as the root
>> directory of an HTTPD server.
>>
>> any .war file or directory (effectively an exploded .war file) you put
>> in tomcat/webapps will be treated as an application.
>>
>>
>> p>
> Just to understand you:
> 
> i have copied the class files of my webapp and modified the relative web.xml
> to the folder
> 
> C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT
> 
> i hope you mean the same ROOT?


Yes, this is correct.


p


Re: standardize the URL

Posted by banto <ba...@gmail.com>.


Pid * wrote:
> 
> On 22/04/2010 10:10, banto wrote:
>> 
>> 
>> 
>> Pid * wrote:
>>>
>>> On 22/04/2010 07:45, banto wrote:
>>>>
>>>>
>>>>
>>>> Gregor Schneider wrote:
>>>>>
>>>>> On Tue, Apr 20, 2010 at 12:54 PM, banto <ba...@gmail.com> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> i know this can be a silly question but i have the following issue:
>>>>>>
>>>>>> i want to call my web app with a standard URL as
>>>>>> http://host:port/myString
>>>>>>
>>>>>
>>>>> how does the url look like when you call your webb-app currently?
>>>>>
>>>>> how would you like the url to look like?
>>>>>
>>>>> rgds
>>>>>
>>>>> gregor
>>>>> -- 
>>>>> just because you're paranoid, don't mean they're not after you...
>>>>> gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
>>>>> gpgp-key available
>>>>> @ http://pgpkeys.pca.dfn.de:11371
>>>>> @ http://pgp.mit.edu:11371/
>>>>> skype:rc46fi
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> I explain better my problem,
>>>>
>>>> my webapp is in the folder:
>>>>
>>>> C:\Program Files\Apache Software Foundation\Tomcat
>>>> 5.5\webapps\istanceVar
>>>>
>>>> and i call it with
>>>>
>>>> http://localhost:8080/instanceVar/instance
>>>>
>>>> what i would like to do (also for others webapps) is to call it/them as
>>>>
>>>> http://localhost:8080/instance
>>>> http://localhost:8080/webapp_2
>>>> http://localhost:8080/webapp_3
>>>
>>> Rename the webapp, from "instanceVar" to "ROOT".
>>>
>>>> or better
>>>>
>>>> http://localhost/instance
>>>> http://localhost/webapp_2
>>>> http://localhost/webapp_3
>>>
>>> Change the port in the Connector from 8080 to 80.
>>>
>>>> how can i get the 2 modes?
>>>
>>> Then add multiple mappings for each instance of the URL.
>>>
>>>
>>> OR
>>>
>>> Create the servlet and map it to a value also present in the
>>> welcome-file list of file names.
>>>
>>>  http://localhost/instanceVar
>>>  http://localhost/webapp_2
>>>
>>>
>>> p
>> 
>> thank you g now it works.
>> 
>> However i understand the only way to do that is putting the webapps in
>> the
>> ROOT folder,right?
> 
> If by webapp, you mean "Servlet".
> 
> ROOT is a webapp in it's own right, it is not the same as the root
> directory of an HTTPD server.
> 
> any .war file or directory (effectively an exploded .war file) you put
> in tomcat/webapps will be treated as an application.
> 
> 
> p
> 
> 
> 
>  
> 


Just to understand you:

i have copied the class files of my webapp and modified the relative web.xml
to the folder

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT

i hope you mean the same ROOT?

thanks
-- 
View this message in context: http://old.nabble.com/standardize-the-URL-tp28287836p28326999.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: standardize the URL

Posted by Pid <pi...@pidster.com>.
On 22/04/2010 10:10, banto wrote:
> 
> 
> 
> Pid * wrote:
>>
>> On 22/04/2010 07:45, banto wrote:
>>>
>>>
>>>
>>> Gregor Schneider wrote:
>>>>
>>>> On Tue, Apr 20, 2010 at 12:54 PM, banto <ba...@gmail.com> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> i know this can be a silly question but i have the following issue:
>>>>>
>>>>> i want to call my web app with a standard URL as
>>>>> http://host:port/myString
>>>>>
>>>>
>>>> how does the url look like when you call your webb-app currently?
>>>>
>>>> how would you like the url to look like?
>>>>
>>>> rgds
>>>>
>>>> gregor
>>>> -- 
>>>> just because you're paranoid, don't mean they're not after you...
>>>> gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
>>>> gpgp-key available
>>>> @ http://pgpkeys.pca.dfn.de:11371
>>>> @ http://pgp.mit.edu:11371/
>>>> skype:rc46fi
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>> I explain better my problem,
>>>
>>> my webapp is in the folder:
>>>
>>> C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\istanceVar
>>>
>>> and i call it with
>>>
>>> http://localhost:8080/instanceVar/instance
>>>
>>> what i would like to do (also for others webapps) is to call it/them as
>>>
>>> http://localhost:8080/instance
>>> http://localhost:8080/webapp_2
>>> http://localhost:8080/webapp_3
>>
>> Rename the webapp, from "instanceVar" to "ROOT".
>>
>>> or better
>>>
>>> http://localhost/instance
>>> http://localhost/webapp_2
>>> http://localhost/webapp_3
>>
>> Change the port in the Connector from 8080 to 80.
>>
>>> how can i get the 2 modes?
>>
>> Then add multiple mappings for each instance of the URL.
>>
>>
>> OR
>>
>> Create the servlet and map it to a value also present in the
>> welcome-file list of file names.
>>
>>  http://localhost/instanceVar
>>  http://localhost/webapp_2
>>
>>
>> p
> 
> thank you g now it works.
> 
> However i understand the only way to do that is putting the webapps in the
> ROOT folder,right?

If by webapp, you mean "Servlet".

ROOT is a webapp in it's own right, it is not the same as the root
directory of an HTTPD server.

any .war file or directory (effectively an exploded .war file) you put
in tomcat/webapps will be treated as an application.


p



Re: standardize the URL

Posted by banto <ba...@gmail.com>.


Pid * wrote:
> 
> On 22/04/2010 07:45, banto wrote:
>> 
>> 
>> 
>> Gregor Schneider wrote:
>>>
>>> On Tue, Apr 20, 2010 at 12:54 PM, banto <ba...@gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> i know this can be a silly question but i have the following issue:
>>>>
>>>> i want to call my web app with a standard URL as
>>>> http://host:port/myString
>>>>
>>>
>>> how does the url look like when you call your webb-app currently?
>>>
>>> how would you like the url to look like?
>>>
>>> rgds
>>>
>>> gregor
>>> -- 
>>> just because you're paranoid, don't mean they're not after you...
>>> gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
>>> gpgp-key available
>>> @ http://pgpkeys.pca.dfn.de:11371
>>> @ http://pgp.mit.edu:11371/
>>> skype:rc46fi
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>> 
>> 
>> I explain better my problem,
>> 
>> my webapp is in the folder:
>> 
>> C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\istanceVar
>> 
>> and i call it with
>> 
>> http://localhost:8080/instanceVar/instance
>> 
>> what i would like to do (also for others webapps) is to call it/them as
>> 
>> http://localhost:8080/instance
>> http://localhost:8080/webapp_2
>> http://localhost:8080/webapp_3
> 
> Rename the webapp, from "instanceVar" to "ROOT".
> 
>> or better
>> 
>> http://localhost/instance
>> http://localhost/webapp_2
>> http://localhost/webapp_3
> 
> Change the port in the Connector from 8080 to 80.
> 
>> how can i get the 2 modes?
> 
> Then add multiple mappings for each instance of the URL.
> 
> 
> OR
> 
> Create the servlet and map it to a value also present in the
> welcome-file list of file names.
> 
>  http://localhost/instanceVar
>  http://localhost/webapp_2
> 
> 
> p
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 


thank you g now it works.

However i understand the only way to do that is putting the webapps in the
ROOT folder,right?
-- 
View this message in context: http://old.nabble.com/standardize-the-URL-tp28287836p28326093.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: standardize the URL

Posted by Pid <pi...@pidster.com>.
On 22/04/2010 07:45, banto wrote:
> 
> 
> 
> Gregor Schneider wrote:
>>
>> On Tue, Apr 20, 2010 at 12:54 PM, banto <ba...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> i know this can be a silly question but i have the following issue:
>>>
>>> i want to call my web app with a standard URL as
>>> http://host:port/myString
>>>
>>
>> how does the url look like when you call your webb-app currently?
>>
>> how would you like the url to look like?
>>
>> rgds
>>
>> gregor
>> -- 
>> just because you're paranoid, don't mean they're not after you...
>> gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
>> gpgp-key available
>> @ http://pgpkeys.pca.dfn.de:11371
>> @ http://pgp.mit.edu:11371/
>> skype:rc46fi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
> 
> 
> I explain better my problem,
> 
> my webapp is in the folder:
> 
> C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\istanceVar
> 
> and i call it with
> 
> http://localhost:8080/instanceVar/instance
> 
> what i would like to do (also for others webapps) is to call it/them as
> 
> http://localhost:8080/instance
> http://localhost:8080/webapp_2
> http://localhost:8080/webapp_3

Rename the webapp, from "instanceVar" to "ROOT".

> or better
> 
> http://localhost/instance
> http://localhost/webapp_2
> http://localhost/webapp_3

Change the port in the Connector from 8080 to 80.

> how can i get the 2 modes?

Then add multiple mappings for each instance of the URL.


OR

Create the servlet and map it to a value also present in the
welcome-file list of file names.

 http://localhost/instanceVar
 http://localhost/webapp_2


p










Re: standardize the URL

Posted by banto <ba...@gmail.com>.


Gregor Schneider wrote:
> 
> On Tue, Apr 20, 2010 at 12:54 PM, banto <ba...@gmail.com> wrote:
>>
>> Hi,
>>
>> i know this can be a silly question but i have the following issue:
>>
>> i want to call my web app with a standard URL as
>> http://host:port/myString
>>
> 
> how does the url look like when you call your webb-app currently?
> 
> how would you like the url to look like?
> 
> rgds
> 
> gregor
> -- 
> just because you're paranoid, don't mean they're not after you...
> gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
> gpgp-key available
> @ http://pgpkeys.pca.dfn.de:11371
> @ http://pgp.mit.edu:11371/
> skype:rc46fi
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 


I explain better my problem,

my webapp is in the folder:

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\istanceVar

and i call it with

http://localhost:8080/instanceVar/instance

what i would like to do (also for others webapps) is to call it/them as

http://localhost:8080/instance
http://localhost:8080/webapp_2
http://localhost:8080/webapp_3
...

or better

http://localhost/instance
http://localhost/webapp_2
http://localhost/webapp_3
...

how can i get the 2 modes?

i hope it is clearer now

thanks.
-- 
View this message in context: http://old.nabble.com/standardize-the-URL-tp28287836p28324762.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: standardize the URL

Posted by Gregor Schneider <rc...@googlemail.com>.
On Tue, Apr 20, 2010 at 12:54 PM, banto <ba...@gmail.com> wrote:
>
> Hi,
>
> i know this can be a silly question but i have the following issue:
>
> i want to call my web app with a standard URL as http://host:port/myString
>

how does the url look like when you call your webb-app currently?

how would you like the url to look like?

rgds

gregor
-- 
just because you're paranoid, don't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available
@ http://pgpkeys.pca.dfn.de:11371
@ http://pgp.mit.edu:11371/
skype:rc46fi

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


Re: standardize the URL

Posted by Pid <pi...@pidster.com>.
On 20/04/2010 11:54, banto wrote:
> 
> Hi,
> 
> i know this can be a silly question but i have the following issue:
> 
> i want to call my web app with a standard URL as http://host:port/myString

OK

> regardless from the path of the servlet under Tomcat tree. I have made some
> try in web.xml url-pattern field but no success. Any advice?

I don't understand the question I'm afraid, would you mind explaining?

Also, which exact versions of OS, JVM, Tomcat are you running?


p