You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Richard W. Adams" <RW...@UP.COM> on 2011/10/12 16:55:45 UTC

Pound Signs in Context/Paths

My Tomcat Version: 6.0.18.0 (running under Jboss)

I'm trying to understand the script we use to deploy to our Tomcat server. 
=

The scripts uses pound signs (#) instead of slashes in the path to the WAR 
=

file being deployed. Let me first be clear:  The script works. What I=20
DON'T understand is why, or the purpose of the pound signs.  I tried=20
searching the Web for documentation on the use of the pound signs, but=20
came up dry.  I'm concerned that we might be using an undocumented feature 
=

that could break in future versions of Tomcat.

Can anyone point me to official documentation about pound signs (#) in=20
Tomcat paths/contexts?

**

This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient.  Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law.  If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies.
**

Re: Pound Signs in Context/Paths

Posted by Pid <pi...@pidster.com>.
On 12/10/2011 15:55, Richard W. Adams wrote:
> My Tomcat Version: 6.0.18.0 (running under Jboss)

That's old.

> I'm trying to understand the script we use to deploy to our Tomcat server. 
> =
> 
> The scripts uses pound signs (#) instead of slashes in the path to the WAR 
> =
> 
> file being deployed. Let me first be clear:  The script works. What I=20
> DON'T understand is why, or the purpose of the pound signs.  I tried=20
> searching the Web for documentation on the use of the pound signs, but=20
> came up dry.  I'm concerned that we might be using an undocumented feature 
> =
> 
> that could break in future versions of Tomcat.
> 
> Can anyone point me to official documentation about pound signs (#) in=20
> Tomcat paths/contexts?

 tomcat/webapps/myapp#is#here.war

is published as

 http://hostname/myapp/is/here
                ^^^^^^^^^^^^^^

where the highlighted part is the context path.

This is called mult-level paths:

  http://tomcat.apache.org/tomcat-6.0-doc/config/context.html



p


Re: Pound Signs in Context/Paths

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Konstantin,

On 10/12/2011 9:22 PM, Konstantin Kolinko wrote:
> Yes, if you want your webapp to be deployed at a subdirectory
> path, such as "foo/bar/baz", "myapp/help", "myapp/tests" etc., you
> cannot just name it foo/bar/baz.war.  So '/' has to be replaced
> with something.  This replacement is '#'.

Just a bit of further explanation: the # symbol was chosen because it
is not a valid symbol in a URL, other than to identify an anchor in
the page.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6XRp4ACgkQ9CaO5/Lv0PCU3gCaAweLBv8CYcGcqgBT++aL71LK
Nb4AoMIijLNKl/ldwRS/KDvVP1GwFAUA
=E+/B
-----END PGP SIGNATURE-----

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


Re: Pound Signs in Context/Paths

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/10/12 André Warnier <aw...@ice-sa.com>:
> Hi.
>
> [OT] How do you manage to send the text of your messages in
> "quoted-printable" form ?
>
>
> Richard W. Adams wrote:
>>
>> My Tomcat Version: 6.0.18.0 (running under Jboss)
>>
>> I'm trying to understand the script we use to deploy to our Tomcat server.
>> =
>>
>> The scripts uses pound signs (#) instead of slashes in the path to the WAR
>> =
>>
>> file being deployed. Let me first be clear:  The script works. What I=20
>> DON'T understand is why, or the purpose of the pound signs.  I tried=20
>> searching the Web for documentation on the use of the pound signs, but=20
>> came up dry.  I'm concerned that we might be using an undocumented feature
>> =
>>
>> that could break in future versions of Tomcat.
>>
>> Can anyone point me to official documentation about pound signs (#) in=20
>> Tomcat paths/contexts?
>>
> You are right, this is not particularloy easy to find.
> Several mentions to the use of "#" in paths are made in this section of the
> on-line documentation.
>
> http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Automatic%20Application%20Deployment

More here:
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming

Warning: the docs are from 7.0.

- Tomcat 6 does not use ##
- Tomcat 6.0.18 is rather old.  There were some fixes in '#'
processing after that. I am not sure how '#' will work in that old
version.

See also:
http://tomcat.apache.org/security-6.html

>
> I do not really understand it very well myself, but as a starter to dig
> further :
> If you use "foo#bar.war" a .war file name, and you drop this .war file in
> Tomcat's webapps directory, it will be deployed at the path
> (tomcat_dir)/webapps/foo/bar/.
>
> So it's a "trick" when you actually want to deploy an application that way,
> because of course you cannot name your war file "foo/bar.war".

Yes, if you want your webapp to be deployed at a subdirectory path,
such as "foo/bar/baz", "myapp/help", "myapp/tests" etc., you cannot
just name it foo/bar/baz.war.  So '/' has to be replaced with
something.  This replacement is '#'.

> And you can also not drop a "bar.war" file in the directory
> (tomcat_dir)/webapps/foo/, because it would never get deployed.

Moreover, a web application is not obliged to have a WEB-INF directory
and web.xml file.

So ${catalina.base}/webapps/foo/  would be just a web application
"foo" that supposedly contains only static files.

>
> I know that this is a very limited way to describe this feature, but maybe
> someone else here will point you to further info of interest.
>

Best regards,
Konstantin Kolinko

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


Re: Pound Signs in Context/Paths

Posted by André Warnier <aw...@ice-sa.com>.
Hi.

[OT] How do you manage to send the text of your messages in "quoted-printable" form ?


Richard W. Adams wrote:
> My Tomcat Version: 6.0.18.0 (running under Jboss)
> 
> I'm trying to understand the script we use to deploy to our Tomcat server. 
> =
> 
> The scripts uses pound signs (#) instead of slashes in the path to the WAR 
> =
> 
> file being deployed. Let me first be clear:  The script works. What I=20
> DON'T understand is why, or the purpose of the pound signs.  I tried=20
> searching the Web for documentation on the use of the pound signs, but=20
> came up dry.  I'm concerned that we might be using an undocumented feature 
> =
> 
> that could break in future versions of Tomcat.
> 
> Can anyone point me to official documentation about pound signs (#) in=20
> Tomcat paths/contexts?
> 
You are right, this is not particularloy easy to find.
Several mentions to the use of "#" in paths are made in this section of the on-line 
documentation.

http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Automatic%20Application%20Deployment

I do not really understand it very well myself, but as a starter to dig further :
If you use "foo#bar.war" a .war file name, and you drop this .war file in Tomcat's webapps 
directory, it will be deployed at the path (tomcat_dir)/webapps/foo/bar/.

So it's a "trick" when you actually want to deploy an application that way, because of 
course you cannot name your war file "foo/bar.war".
And you can also not drop a "bar.war" file in the directory (tomcat_dir)/webapps/foo/, 
because it would never get deployed.

I know that this is a very limited way to describe this feature, but maybe someone else 
here will point you to further info of interest.




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