You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2009/05/05 15:22:18 UTC

Re: context setting problem

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tohid,

On 4/18/2009 2:46 AM, tohid noroozi wrote:
> i use context tag in server.xml like this :
>       <Host name="localhost"              unpackWARs="true"
> autoDeploy="true"   xmlValidation="false" xmlNamespaceAware="false">
>                 <Context  path="" docBase="D:/web-server/Tomcat
> 6.0/webapps/ROOT" />
>                 <Context  path="/outside" docBase="D:/web-server/Tomcat
> 6.0/portal"/>
>           <Alias>www.tnr.com</Alias>
>       </Host>
> 
> what i want is set [Tomcat 6.0/webaps/root] as physical address of site and
> [Tomcat 6.0/portal] to use when url is [localhost/outsie] .
> my problem is jsp files in Tomcat 6.0/portal has different application
> context and i cant use it ass part of localhost site with same context .
> i wouldnt like to put this folder  inside webapps/ROOT direcotry and i want
> put this directory out side  .

I think what you want is this:

<Host name="localhost" ...>
   <Context path="" docBase="D:/web-server/Tomcat 6.0/webapps/ROOT" />
</Host>
<Host name="www.tnr.com" ...>
   <Context path="" docBase="D:/web-server/Tomcat 6.0/portal"/>
</Host>

Since it's not recommended to put <Context> elements into your
server.xml, you probably want to define just the <Host> elements and
either use different docBase attributes, or create
conf/Catalina/localhost/ROOT.xml and conf/Catalina/www.tnr.com/ROOT.xml
files instead.

> some attribute such as  crossContext="true"  privileged="true"
> allowLinking="true" has not any effect for me.

These attributes have nothing to do with the host or the context path,
so setting them arbitrarily will not help you.

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

iEYEARECAAYFAkoAPYoACgkQ9CaO5/Lv0PDIqACeLNZTj2K/RsDHz3j//iNo3lul
FOUAoJL26fyjrWQkH48xkKbn4H5dx1DK
=FfR1
-----END PGP SIGNATURE-----

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