Quantcast

Tomcat6 - Context - aliases

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Tomcat6 - Context - aliases

Léa Massiot
Hello,

I've been struggling lately with the "aliases" attribute of the "Context"
element of the "context.xml" file.
I tested a Webapp with "Tomcat7" and it appears to work properly.
As a "Debian" user, "Tomcat7" is not yet packaged in the current stable
release "Squeeze" so I installed "Tomcat6" instead.
Result: the Webapp no longer works properly (as far as the "aliases"
attribute is concerned).
When I have a look at the "Tomcat6" documentation
(http://tomcat.apache.org/tomcat-6.0-doc/config/context.html), it looks like
the "Context" element "aliases" attribute is not available.

1) Can you confirm it is not?
2) How can I workaround this problem?

Thanks for helping.

--
View this message in context: http://tomcat.10.n6.nabble.com/Tomcat6-Context-aliases-tp4678428p4678428.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Teppei Yamada
Hi,


Can I ask you some questions?

1. What version of Tomcat7 did you test?
2. Where do you place context.xml in Tomcat6?

I don't know you are aware that context.xml placed in
yourwebapp/META-INF/context.xml is automatically copied to
TOMCAT_HOME/conf/Catalina/(hostname(usually localhost)/yourapp.xml.
Once copied, Tomcat6 refers the one in TOMCAT_HOME/conf.

Tomcat7.0.26 no longer copies context.xml.

Regards,
Teppei

On 12/04/02 18:59, "Léa Massiot" <[hidden email]> wrote:

>Hello,
>
>I've been struggling lately with the "aliases" attribute of the "Context"
>element of the "context.xml" file.
>I tested a Webapp with "Tomcat7" and it appears to work properly.
>As a "Debian" user, "Tomcat7" is not yet packaged in the current stable
>release "Squeeze" so I installed "Tomcat6" instead.
>Result: the Webapp no longer works properly (as far as the "aliases"
>attribute is concerned).
>When I have a look at the "Tomcat6" documentation
>(http://tomcat.apache.org/tomcat-6.0-doc/config/context.html), it looks
>like
>the "Context" element "aliases" attribute is not available.
>
>1) Can you confirm it is not?
>2) How can I workaround this problem?
>
>Thanks for helping.
>
>--
>View this message in context:
>http://tomcat.10.n6.nabble.com/Tomcat6-Context-aliases-tp4678428p4678428.h
>tml
>Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Konstantin Kolinko
In reply to this post by Léa Massiot
2012/4/2 Léa Massiot <[hidden email]>:

>
> I've been struggling lately with the "aliases" attribute of the "Context"
> element of the "context.xml" file.
> I tested a Webapp with "Tomcat7" and it appears to work properly.
> As a "Debian" user, "Tomcat7" is not yet packaged in the current stable
> release "Squeeze" so I installed "Tomcat6" instead.
> Result: the Webapp no longer works properly (as far as the "aliases"
> attribute is concerned).
> When I have a look at the "Tomcat6" documentation
> (http://tomcat.apache.org/tomcat-6.0-doc/config/context.html), it looks like
> the "Context" element "aliases" attribute is not available.
>
> 1) Can you confirm it is not?

aliases are a feature added to Tomcat 7. They are not available in
earlier versions.

The feature is too intrusive to ever consider its backporting.

> 2) How can I workaround this problem?

Install Tomcat 7. Read RUNNING.txt for a start.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Léa Massiot
Hello,

Thank you for your answers.

Teppei Yamada wrote
1. What version of Tomcat7 did you test?
On a Windows XP machine: Tomcat 7.0.20
On a Debian Squeeze machine: Tomcat 7.0.22

Teppei Yamada wrote
2. Where do you place context.xml in Tomcat6?
I don't know you are aware that context.xml placed in
yourwebapp/META-INF/context.xml is automatically copied to
TOMCAT_HOME/conf/Catalina/(hostname(usually localhost)/yourapp.xml.
Once copied, Tomcat6 refers the one in TOMCAT_HOME/conf.
Tomcat7.0.26 no longer copies context.xml.
I placed "context.xml" in "yourwebapp/META-INF/".
I am aware of what you mentionned above.
I remember reading that "Tomcat6" copies "context.xml" to "TOMCAT_HOME/conf/Catalina/(hostname(usually localhost)/yourapp.xml" only the first time the Webapp is deployed.

Konstantin Kolinko wrote
aliases are a feature added to Tomcat 7. They are not available in
earlier versions.
The feature is too intrusive to ever consider its backporting.
I see.

Konstantin Kolinko wrote
Install Tomcat 7. Read RUNNING.txt for a start.
I prefer not to. As I wrote, "Tomcat7" is not packaged yet in "Debian" stable "Squeeze".
For security reasons, I want to use only stable, packaged and up-to-date OS and software versions.
I there any other workaround... I mean... I guess even before "Tomcat7", people needed to declare such "aliases".

Thank you for your help and best regards.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Daniel Mikusa-2


----- Original Message -----

> Hello,
>
> Thank you for your answers.
>
>
> Teppei Yamada wrote
> > 1. What version of Tomcat7 did you test?
> On a Windows XP machine: Tomcat 7.0.20
> On a Debian Squeeze machine: Tomcat 7.0.22
>
>
> Teppei Yamada wrote
> > 2. Where do you place context.xml in Tomcat6?
> > I don't know you are aware that context.xml placed in
> > yourwebapp/META-INF/context.xml is automatically copied to
> > TOMCAT_HOME/conf/Catalina/(hostname(usually localhost)/yourapp.xml.
> > Once copied, Tomcat6 refers the one in TOMCAT_HOME/conf.
> > Tomcat7.0.26 no longer copies context.xml.
> I placed "context.xml" in "yourwebapp/META-INF/".
> I am aware of what you mentionned above.
> I remember reading that "Tomcat6" copies "context.xml" to
> "TOMCAT_HOME/conf/Catalina/(hostname(usually localhost)/yourapp.xml"
> only
> the first time the Webapp is deployed.
>
>
> Konstantin Kolinko wrote
> > aliases are a feature added to Tomcat 7. They are not available in
> > earlier versions.
> > The feature is too intrusive to ever consider its backporting.
> >
>
> I see.
>
>
> Konstantin Kolinko wrote
> > Install Tomcat 7. Read RUNNING.txt for a start.

+1


> I prefer not to. As I wrote, "Tomcat7" is not packaged yet in
> "Debian"
> stable "Squeeze".

I'm not a fan of using Tomcat from a package repo.


> For security reasons, I want to use only stable, packaged and
> up-to-date OS
> and software versions.

I think your logic is backwards here.  In my experience, the package manager repos almost always lag behind (sometimes WAY behind) on Tomcat versions.  It might not seem to be a problem to hang a couple versions back, but you could miss a critical security patch this way.

I would suggest that you install the latest release from tomcat.apache.org, and keep an eye on the mailing lists for announcements regarding security advisories and version updates.

Dan


> I there any other workaround... I mean... I guess even before
> "Tomcat7",
> people needed to declare such "aliases".
>
> Thank you for your help and best regards.
>
> --
> View this message in context:
> http://tomcat.10.n6.nabble.com/Tomcat6-Context-aliases-tp4678430p4678513.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Léa Massiot
Thank you for your advice.

And how did people do to declare aliases before the "aliases" attribute of the "Context" element was introduced in "Tomcat7"?
Pid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Pid
On 02/04/2012 15:23, Léa Massiot wrote:
> Thank you for your advice.
>
> And how did people do to declare aliases before the "aliases" attribute of
> the "Context" element was introduced in "Tomcat7"?

Either they did not, or they selected an alternative based on their
use-case.  What is your exact requirement?


p


> --
> View this message in context: http://tomcat.10.n6.nabble.com/Tomcat6-Context-aliases-tp4678430p4679060.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


--

[key:62590808]


signature.asc (964 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Léa Massiot
Pid * wrote
Either they did not, or they selected an alternative based on their use-case.
I'm sure they did. You'll see below, my requirements are basic.

Pid * wrote
What is your exact requirement?
- Users upload files to the server running Tomcat.
- The Webapp stores these file on the hard disk in some directory which has nothing to do neither with the Webapp nor with the Tomcat engine. Let's name it "d1".
- I needed an alias for the directory "d1" to refer to it from inside the Webapp.
  I created a "META-INF/context.xml":

  <?xml version='1.0' encoding='UTF-8'?>
  <Context aliases="/<an_alias_1>=<d1>">
  </Context>

Of course, it works as expected with "Tomcat7".

I "just" want to do something equivalent which works with "Tomcat6".

Thank you for helping me and best regards.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

André Warnier
Léa Massiot wrote:

> Pid * wrote
>> Either they did not, or they selected an alternative based on their
>> use-case.
> I'm sure they did. You'll see below, my requirements are basic.
>
>
> Pid * wrote
>> What is your exact requirement?
> - Users upload files to the server running Tomcat.
> - The Webapp stores these file on the hard disk in some directory which has
> nothing to do neither with the Webapp nor with the Tomcat engine. Let's name
> it "d1".
> - I needed an alias for the directory "d1" to refer to it from inside the
> Webapp.
>   I created a "META-INF/context.xml":
>
>   <?xml version='1.0' encoding='UTF-8'?>
>   <Context aliases=&quot;/&lt;an_alias_1>=<d1>">
>   </Context>
>
> Of course, it works as expected with "Tomcat7".
>
> I "just" want to do something equivalent which works with "Tomcat6".
>

this might help, in a container- and version-independent way :
http://jaitechwriteups.blogspot.de/2007/01/how-to-read-properties-file-in-web.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Pid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Pid
In reply to this post by Léa Massiot
On 02/04/2012 16:14, Léa Massiot wrote:

>
> Pid * wrote
>> Either they did not, or they selected an alternative based on their
>> use-case.
> I'm sure they did. You'll see below, my requirements are basic.
>
>
> Pid * wrote
>> What is your exact requirement?
> - Users upload files to the server running Tomcat.
> - The Webapp stores these file on the hard disk in some directory which has
> nothing to do neither with the Webapp nor with the Tomcat engine. Let's name
> it "d1".
> - I needed an alias for the directory "d1" to refer to it from inside the
> Webapp.
Please define 'inside'.  Does the application need to perform an
internal forward, or does the client just need to be able to request the
URL for the resource?

In the latter case, put a Context file in:

 tomcat/conf/Catalina/$hostname/$alias.xml

 <?xml version='1.0' encoding='UTF-8'?>
 <Context docBase="/path/to/d1">
 </Context>


p

>   I created a "META-INF/context.xml":
>
>   <?xml version='1.0' encoding='UTF-8'?>
>   <Context aliases=&quot;/&lt;an_alias_1>=<d1>">
>   </Context>
>
> Of course, it works as expected with "Tomcat7".
>
> I "just" want to do something equivalent which works with "Tomcat6".
>
> Thank you for helping me and best regards.
>
>
>
> --
> View this message in context: http://tomcat.10.n6.nabble.com/Tomcat6-Context-aliases-tp4678430p4679237.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--

[key:62590808]


signature.asc (964 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Christopher Schultz-2
In reply to this post by Léa Massiot
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Léa,

On 4/2/12 6:45 AM, Léa Massiot wrote:
> Konstantin Kolinko wrote
>> Install Tomcat 7. Read RUNNING.txt for a start.
>
> I prefer not to. As I wrote, "Tomcat7" is not packaged yet in
> "Debian" stable "Squeeze".

Nor will it. Debian has a fairly conservative release strategy, and I
suspect that Squeeze will *never* have a version of Tomcat 7 available
to the package manager.

> For security reasons, I want to use only stable, packaged and
> up-to-date OS and software versions.

You will probably have to upgrade to Wheezy (currently "testing")
which currently has Tomcat 7.0.26-1 (the "-1" is Debian's additional
patch level version number).

Note that Debian isn't always so fast to back-port security patches so
clinging to the Debian package manager doesn't necessarily make you
more secure... it just makes your security "someone else's problem"
which might be a mistake.

> I there any other workaround... I mean... I guess even before
> "Tomcat7", people needed to declare such "aliases".

You could deploy multiple webapps to get the same behavior as
'aliases'. Or, you could merge your directories together as deploy-time.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk96EdcACgkQ9CaO5/Lv0PCtyQCfe2FdMDFI/E2741bvtjX+PmI9
KOcAn16rx4b2DHGwwwU16jIJ9B5B/TR2
=O/i8
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Léa Massiot
Thank you all three for your last answers.

André Warnier wrote
this might help, in a container- and version-independent way : http://jaitechwriteups.blogspot.de/2007/01/how-to-read-properties-file-in-web.html
I'm sorry, no offence... but I don't see how... :/

Pid * wrote
Please define 'inside'.
In this Web page: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html (look for the first occurrence of the word "aliases" in this document), there is a description of what the "aliases" attribute is used for.
Excerpt: "This attribute provides a list of external locations from which to load resources for this context."
When I use the word "inside" (maybe improperly) I intend to mean the opposite of what is called an "external location" in the documentation mentionned above.

My requirements more clearly now I hope:
I just want to know, what is the "more basic" mechanism which was used in "Tomcat6" to do what the "aliases" attribute of the "Context" element of the "context.xml" file permits now to do in "Tomcat7".

Note 1: I had'nt realized this "aliases" attribute was container-version-dependent. I wouldn't have used it otherwise.
Note 2: Maybe this mechanism has to be implemented directly in the Webapp's source code instead.
Note 3: The interesting idea behind this "external location" notion is to be able to isolate ressources from the Webapp itself and yet being able to refer to them from inside the Webapp.

Thank you for helping and best regards.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

André Warnier
Léa Massiot wrote:
> Thank you all three for your last answers.
>
>
> André Warnier wrote
>> this might help, in a container- and version-independent way :
>> http://jaitechwriteups.blogspot.de/2007/01/how-to-read-properties-file-in-web.html
> I'm sorry, no offence... but I don't see how... :/
>
No offence taken.

What I meant (if I understood your basic issue properly) was :
- you need to tell your webapp where the uploaded files should be stored/retrieved
- you cannot do it via an "alias" under Tomcat < v7
- so instead of an alias, do it via a property in a properties file, which your webapp
would read
This is (almost) a "pure java" solution, which would work under any servlet container of
any version.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Léa Massiot
Hello André,

André Warnier wrote
- you need to tell your webapp where the uploaded files should be stored/retrieved
- you cannot do it via an "alias" under Tomcat < v7
Exactly.

André Warnier wrote
- so instead of an alias, do it via a property in a properties file, which your webapp would read. This is (almost) a "pure java" solution, which would work under any servlet container of any version.
I wish I knew how to do that and yes, I'm interested in an (almost) "pure Java" solution.



May I precise what I did and what already works with Tomcat7:

1) When a user uploads a file to the server running Tomcat, I store the file, for example, in a directory: "/home/d1/"

2) In a JSP, this user can view the list of the "n" files he uploaded:
--------------------------------------------------------------------------------------
< a href="/an_alias_1/file_1.txt"> file_1.txt < /a>
...
< a href="/an_alias_1/file_n.txt"> file_n.txt < /a>
--------------------------------------------------------------------------------------

3) In Tomcat7, I used the "aliases" properties of the "Context" element in "META-INF/context.xml" to ("magically" to me :/), let Tomcat map these addresses:
--------------------------------------------------------------------------------------
/an_alias_1/file_1.txt
...
/an_alias_1/file_n.txt
--------------------------------------------------------------------------------------
to their real addresses on the  filesystem:
--------------------------------------------------------------------------------------
/home/d1/file_1.txt
...
/home/d1/file_n.txt
--------------------------------------------------------------------------------------
so that the user could click on one of these links and retrieve/view the corresponding resource.

Of course, I read carefully what you wrote, it looks like I'm really missing something important because I have absolutely no idea how to "implement" the same mechanism using a properties file as you suggest...
Would you be so very kind to to explain a bit more?

Thank you and best regards.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Léa Massiot
Ok. So, I found a solution, if I can call that a solution.

- I created a file "an_alias_1.xml" in "/etc/tomcat6/Catalina/localhost/" (the OS being Debian Squeeze).

- Here are the contents of this "an_alias_1.xml" file:
< Context path="/an_alias_1" docBase="/home/d1" crossContext="true" / >

- This Configuration Descriptor is automatically deployed once saved.

- I suppressed the Webapp "w"'s "WEB-INF\context.xml" I had created.

- I redeployed the Webapp "w".

=> Now, when a user clicks on any link < a href="/an_alias_1/file_< i>.txt"> file_< i>.txt < /a>
it is successfully retrieved.

=> What is still problematic to me, is that, when the user clicks on a link, the context or Webapp changes (from "w" to "an_alias_1").
The resources which are in "/home/d1" are available directly by typing the following URL in a browser:
http://<hostname>:8080/an_alias_1/file_< i>.txt
and not compulsorily through the Webapp "w".

Best regards.

Ref. - a useful thread on stackoverflow:
http://stackoverflow.com/questions/4575562/how-to-set-up-a-different-context-to-point-to-an-external-directory-outside-weba
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Tomcat6 - Context - aliases

Caldarale, Charles R
> From: Léa Massiot [mailto:[hidden email]]
> Subject: Re: Tomcat6 - Context - aliases

> Ok. So, I found a solution, if I can call that a solution.

How about a much easier solution: install Tomcat 7.  Easier to configure, faster, and more secure.  Stop making your life difficult.

 - 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 unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Konstantin Kolinko
In reply to this post by Léa Massiot
2012/4/4 Léa Massiot <[hidden email]>:
> Ok. So, I found a solution, if I can call that a solution.
>
> - I created a file "an_alias_1.xml" in "/etc/tomcat6/Catalina/localhost/"
> (the OS being Debian Squeeze).
>
> - Here are the contents of this "an_alias_1.xml" file:
> < Context path="/an_alias_1" docBase="/home/d1" crossContext="true" / >

You should remove the path attribute when Context is defined in an XML file.

The name of the xml file itself specifies the path, not the attribute.

See "Context" chapter in configuration reference for details.

>
> - This Configuration Descriptor is automatically deployed once saved.
>
> - I suppressed the Webapp "w"'s "WEB-INF\context.xml" I had created.
>
> - I redeployed the Webapp "w".
>
> => Now, when a user clicks on any link < a href="/an_alias_1/file_< i>.txt">
> file_< i>.txt < /a>
> it is successfully retrieved.
>
> => What is still problematic to me, is that, when the user clicks on a link,
> the context or Webapp changes (from "w" to "an_alias_1").
> The resources which are in "/home/d1" are available directly by typing the
> following URL in a browser:
> http://<hostname>:8080/an_alias_1/file_< i>.txt
> and not compulsorily through the Webapp "w".
>

Best regards.
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Léa Massiot
Konstantin Kolinko wrote
You should remove the path attribute when Context is defined in an XML file.
The name of the xml file itself specifies the path, not the attribute.
Indeed. Thank you.
Best regards.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Christopher Schultz-2
In reply to this post by Léa Massiot
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Léa,

On 4/4/12 2:28 PM, Léa Massiot wrote:
> < Context path="/an_alias_1" docBase="/home/d1" crossContext="true"
> / >

Do you really need crossContext="true" here?

> - This Configuration Descriptor is automatically deployed once
> saved.
>
> - I suppressed the Webapp "w"'s "WEB-INF\context.xml" I had
> created.
>
> - I redeployed the Webapp "w".

This is the first time you mentioned webapp "w". Is that the "main"
webapp?

> => Now, when a user clicks on any link < a href="/an_alias_1/file_<
> i>.txt"> file_< i>.txt < /a> it is successfully retrieved.

Good.

> => What is still problematic to me, is that, when the user clicks
> on a link, the context or Webapp changes (from "w" to
> "an_alias_1").

Why is that a problem?

> The resources which are in "/home/d1" are available directly by
> typing the following URL in a browser:
> http://<hostname>:8080/an_alias_1/file_< i>.txt and not
> compulsorily through the Webapp "w".

Isn't that what you wanted? Or, do you want everything to be exposed
through /w/an_alias_1?

If you want /w/an_alias_1, then re-name your context deployment
descriptor:

$ mv an_alias_1.xml w\#an_alias_1.xml

Honestly, though, I'm not sure it makes any difference: a URL is a
URL. Maybe you just want to make it "look" like the resource "belongs"
to the webapp.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk99pncACgkQ9CaO5/Lv0PB1fgCeJ+kv6Y/UH9NlG4gIJYK36juZ
gE8An3r6kqhEUXY8pCwvb0A9v4YEvItG
=trQU
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat6 - Context - aliases

Léa Massiot
Christopher Schultz-2 wrote
Do you really need crossContext="true" here?
I guess not since - as I just tested - removing it doesn't change anything... Thank you.

So I removed the "crossContext" attribute (and the "path" attribute) and the new contents of "an_alias_1.xml" are:
--------------------------------------------------------------------------------------
< Context docBase="/home/d1" / >
--------------------------------------------------------------------------------------

Christopher Schultz-2 wrote
This is the first time you mentioned webapp "w". Is that the "main" webapp?
Yes.

Christopher Schultz-2 wrote
Why is that a problem?
Actually I realized that even with the previous mechanism I used (using the "aliases" attribute of the "Context" element of the "w/WEB-INF/context.xml" file), I could directly retrieve a resource by typing its exact URL in a browser and without having to identify in any way prior to the retrieval...

Christopher Schultz-2 wrote
If you want /w/an_alias_1, then re-name your context deployment
descriptor:

$ mv an_alias_1.xml w\#an_alias_1.xml
... Actually, this is what I did but I didn't want to complicate my answer. Thank you.

Christopher Schultz-2 wrote
Maybe you just want to make it "look" like the resource "belongs"
to the webapp.
To the Webapp "w", yes.

Thank you for your comments and your interest.
Best regards.
12
Loading...