Re: virtual directory

2013-03-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Tommy,

On 3/21/13 5:00 PM, Tommy Pham wrote:
 Silly me... I figured out what was the issue.  I didn't have the
 index page defined in Tomcat's web.xml within the D:\wwwroot.  The
 eventual content of this folder will be images anyway.  Would I
 need to code an interceptor to detect 404 error and path to
 redirect the visitor to another URL instead of Tomcat's default 404
 error?

I would just configure an error-page in web.xml like usual.

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

iQIcBAEBCAAGBQJRTN40AAoJEBzwKT+lPKRYcYoP/18xFmCLD04KOyGoge2uhjYw
xB6TWT/VHf5pPGk9xY2TJp+nkkIfGiKwPqCovAemV/JdzAYXocsx3P/cbt0Jvzw7
ltVk+Y1non8o6KhrlxAsXpObLYcZzhnLpkefkHIp3awYIwzrgVi4k1GTIKucozzs
4/7QWAjCznxdL0WJln6eJ//pgwOfaSpuNGbXocjY00vy3R3cBveQ94YaxzoyTKvy
s85ubbMSZtvbufof2thvO3c+GWWRRyJpaYCrQZ2Sw0TpUBBj78D3jknenAHssfat
R1qtFi2K0HT2SNHfloYOzgmAyjnpbdOMU6QNXkdc4ckjQzRVO9PczOgj+VMx9h8c
gB4jFzBZFja9i/u9GwR2mBjHJBM1kCjDdfD7Oi0mgj4Mg17CHUGcU4DF9NWJ9Cfb
TMYbNHK53QxFm1Bjb4JiVERdPf1x9UfRg8uv7XResUXTmUHg3Rv/hoMdW4JPN+GZ
oPEc0VcGGz+qXexOoSdgvTqBEOOGvIhl0wcy5j9zh0O7p2fQFx8RcsFQj88hlkGq
UzY/DvWzviErDRGS1FIOCzALnZ2KeRI0uWdAW0nMqXq7X/gATfmnpVakfEtBILUH
Vag9KCQBWWcqynrOy1Svo5vwjuz31CU+Cb8hBruSzF1+9Ei+QG85HVdwjjAxEsTS
SEYdeu5+Y3QGeEi41zrN
=cdDP
-END PGP SIGNATURE-

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



Re: virtual directory

2013-03-21 Thread André Warnier

Tommy Pham wrote:

Hi,

I'm trying to setup my virtual directory wwwroot as
http://localhost/wwwroot/ mapped to d:\wwwroot but I'm getting

HTTP Status 404 - /wwwroot/

type Status report

message /wwwroot/

description The requested resource (/wwwroot/) is not available.
Apache Tomcat/7.0.26



My wwwroot.xml:

?xml version=1.0 encoding=ISO-8859-1?
Context path=/wwwroot docBase=D:/wwwroot debug=0 privileged=true
/Context

and the localhost log:

Mar 21, 2013 10:14:38 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Mar 21, 2013 10:14:38 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor
D:\apache-tomcat-7.0.26\conf\Catalina\localhost\wwwroot.xml
Mar 21, 2013 10:14:38 AM
org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'debug'
to '0' did not find a matching property.
Mar 21, 2013 10:14:39 AM org.apache.catalina.util.SessionIdGenerator
createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation
using [SHA1PRNG] took [145] milliseconds.
Mar 21, 2013 10:14:39 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\apache-tomcat-7.0.26\webapps\docs

Did I misread the doc [1]?

Thanks,
Tommy

[1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html



Well, you seem to have.

path : This attribute must only be used when statically defining a Context in server.xml. 
In all other circumstances, the path will be inferred from the filenames used for either 
the .xml context file or the docBase.


debug : doesn't exist, as your log messages indicate

privileged : are you sure ?



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



Re: virtual directory

2013-03-21 Thread Manuel Fernández Panzuela
To publish your wwwdoc directory you must edit sever.xml and look for Host
tag. Inside this block write a line like::

Context docBase=D:/wwwroot path=/wwwroot reloadable=true /

Don't use debug as André says

:)


Un abrazo


2013/3/21 André Warnier a...@ice-sa.com

 Tommy Pham wrote:

 Hi,

 I'm trying to setup my virtual directory wwwroot as
 http://localhost/wwwroot/ mapped to d:\wwwroot but I'm getting

 HTTP Status 404 - /wwwroot/

 type Status report

 message /wwwroot/

 description The requested resource (/wwwroot/) is not available.
 Apache Tomcat/7.0.26



 My wwwroot.xml:

 ?xml version=1.0 encoding=ISO-8859-1?
 Context path=/wwwroot docBase=D:/wwwroot debug=0 privileged=true
 /Context

 and the localhost log:

 Mar 21, 2013 10:14:38 AM org.apache.catalina.core.**StandardEngine
 startInternal
 INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
 Mar 21, 2013 10:14:38 AM org.apache.catalina.startup.**HostConfig
 deployDescriptor
 INFO: Deploying configuration descriptor
 D:\apache-tomcat-7.0.26\conf\**Catalina\localhost\wwwroot.xml
 Mar 21, 2013 10:14:38 AM
 org.apache.catalina.startup.**SetContextPropertiesRule begin
 WARNING: [SetContextPropertiesRule]{**Context} Setting property 'debug'
 to '0' did not find a matching property.
 Mar 21, 2013 10:14:39 AM org.apache.catalina.util.**SessionIdGenerator
 createSecureRandom
 INFO: Creation of SecureRandom instance for session ID generation
 using [SHA1PRNG] took [145] milliseconds.
 Mar 21, 2013 10:14:39 AM org.apache.catalina.startup.**HostConfig
 deployDirectory
 INFO: Deploying web application directory D:\apache-tomcat-7.0.26\**
 webapps\docs

 Did I misread the doc [1]?

 Thanks,
 Tommy

 [1] 
 http://tomcat.apache.org/**tomcat-7.0-doc/config/context.**htmlhttp://tomcat.apache.org/tomcat-7.0-doc/config/context.html


 Well, you seem to have.

 path : This attribute must only be used when statically defining a Context
 in server.xml. In all other circumstances, the path will be inferred from
 the filenames used for either the .xml context file or the docBase.

 debug : doesn't exist, as your log messages indicate

 privileged : are you sure ?




 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@tomcat.**apache.orgusers-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: virtual directory

2013-03-21 Thread André Warnier

Manuel Fernández Panzuela wrote:

To publish your wwwdoc directory you must edit sever.xml and look for Host
tag. Inside this block write a line like::

Context docBase=D:/wwwroot path=/wwwroot reloadable=true /


Hi.
Don't top-post.
And the page which the original poster apparently mis-read, also says (in bold) 
:

It is NOT recommended to place Context elements directly in the server.xml 
file.

https://tomcat.apache.org/tomcat-7.0-doc/config/context.html

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



Re: virtual directory

2013-03-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Tommy,

On 3/21/13 1:23 PM, Tommy Pham wrote:
 I'm trying to setup my virtual directory wwwroot as 
 http://localhost/wwwroot/ mapped to d:\wwwroot but I'm getting
 
 HTTP Status 404 - /wwwroot/
 
 type Status report
 
 message /wwwroot/
 
 description The requested resource (/wwwroot/) is not available. 
 Apache Tomcat/7.0.26
 
 
 My wwwroot.xml:
 
 ?xml version=1.0 encoding=ISO-8859-1? Context
 path=/wwwroot docBase=D:/wwwroot debug=0 privileged=true 
 /Context

I would have expected this to work, though you should take André's
suggestions and clean-up that file. What is in D:\wwwroot?

Where did you put wwwroot.xml?

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

iQIcBAEBCAAGBQJRS1kaAAoJEBzwKT+lPKRYLL0P/0ThqoCuRoep+QJFHsYHdGWS
5QUpzPBXrvG9o1oEdnUJrz1/Y854waF/XzvTNYFKDyeFvkD2M3TV610vwcEB7A2v
/8CPZAuB56084TYU6MbJkwivOkUPBPEphLjrkMavuNYlfVH8Mifp7d4ZwKJ7mwJz
xGly9NeqfzyVjXXxjwn8FGxvlnqLxcZyTwxvleiDnllk7HxXrfx1a9+ELpU8l+A0
Tzmn87hNmNrdpwqfJ8g3EKH/r6bitRYhqDld2Q/agzNDmPLiYwby7HWg3Tmh3gfK
MQkQekYhp3kY48VhrNI1g79+m4Pt0LJQaCElwe+GaYkX3lZLB2TR61EVUG9V31b2
cRcCqgbnBbfYHOREvC+FTb5URUmrXgG9/5NZ/t/EaHSsHlArOWCSSS/g8cDL9NjE
pSDF4elWrclUGHzcPKE9p925/lMRHWDC9NpBf97o+z2SIPzBufeFSZ8AxKHlO6Yj
Ytb0geE3I3hiuSfdYq668gvMV+UA6+fhZ7CZHdSCM9Ul3YSf8xAJQE1B1csghF+0
zHwZTFR3K2dXUwm7InqscmSUh/I+94fBs7m2z6aQ3BuKCF7dZeycROoddu8YJucw
1byxSWRtnIU1FQbzT62Fufbb6y5ycbrw8j/jptJ9XU14I/2l7GDO5Y0aelkrh84n
VUB5SVTZs3Hgevz2k4Of
=YHLS
-END PGP SIGNATURE-

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



Re: virtual directory

2013-03-21 Thread Tommy Pham
On Thu, Mar 21, 2013 at 11:10 AM, André Warnier a...@ice-sa.com wrote:
 Manuel Fernández Panzuela wrote:

 To publish your wwwdoc directory you must edit sever.xml and look for
 Host
 tag. Inside this block write a line like::

 Context docBase=D:/wwwroot path=/wwwroot reloadable=true /

 Hi.
 Don't top-post.
 And the page which the original poster apparently mis-read, also says (in
 bold) :

 It is NOT recommended to place Context elements directly in the server.xml
 file.

 https://tomcat.apache.org/tomcat-7.0-doc/config/context.html



Hi André,

Thanks for the feedback.  I'm still getting the 404 error with this wwwroot.xml:

?xml version=1.0 encoding=ISO-8859-1?
Context docBase=D:/wwwroot
/Context

And the catalina log shows:Mar 21, 2013 11:46:27 AM

org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Mar 21, 2013 11:46:27 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor
D:\apache-tomcat-7.0.26\conf\Catalina\localhost\wwwroot.xml
Mar 21, 2013 11:46:28 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\apache-tomcat-7.0.26\webapps\docs
Mar 21, 2013 11:46:28 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory
D:\apache-tomcat-7.0.26\webapps\examples

Thanks,
Tommy

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



Re: virtual directory

2013-03-21 Thread André Warnier

Tommy Pham wrote:

On Thu, Mar 21, 2013 at 11:10 AM, André Warnier a...@ice-sa.com wrote:

Manuel Fernández Panzuela wrote:

To publish your wwwdoc directory you must edit sever.xml and look for
Host
tag. Inside this block write a line like::

Context docBase=D:/wwwroot path=/wwwroot reloadable=true /


Hi.
Don't top-post.
And the page which the original poster apparently mis-read, also says (in
bold) :

It is NOT recommended to place Context elements directly in the server.xml
file.

https://tomcat.apache.org/tomcat-7.0-doc/config/context.html




Hi André,

Thanks for the feedback.  I'm still getting the 404 error with this wwwroot.xml:

?xml version=1.0 encoding=ISO-8859-1?
Context docBase=D:/wwwroot
/Context

And the catalina log shows:Mar 21, 2013 11:46:27 AM

org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Mar 21, 2013 11:46:27 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor
D:\apache-tomcat-7.0.26\conf\Catalina\localhost\wwwroot.xml
Mar 21, 2013 11:46:28 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\apache-tomcat-7.0.26\webapps\docs
Mar 21, 2013 11:46:28 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory
D:\apache-tomcat-7.0.26\webapps\examples




Like Christopher, I would have expected this to work.
So, a few stupid questions (but one never knows) :
- is there actually something in D:\wwwroot ? if yes, what ?
- is your browser (window) opened on the same host as where you have tomcat 
installed ?
- is it this tomcat that is listening on port 80 ?
- do you have more than 1 (uncommented) Host in your server.xml ?
- can you call up http://localhost/docs ?
- what happens if you copy what is now in D:\wwwroot, to 
D:\apache-tomcat-7.0.26\webapps\wwwroot ?


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



RE: virtual directory

2013-03-21 Thread Caldarale, Charles R
 From: Tommy Pham [mailto:tommy...@gmail.com] 
 Subject: Re: virtual directory

 I'm still getting the 404 error with this wwwroot.xml:

 ?xml version=1.0 encoding=ISO-8859-1?
 Context docBase=D:/wwwroot
 /Context

In addition to the questions André asked, one very critical one: where is that 
wwwroot.xml file located?

 - 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: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: virtual directory

2013-03-21 Thread Tommy Pham
Hi Chuck and Andre,

Silly me... I figured out what was the issue.  I didn't have the index
page defined in Tomcat's web.xml within the D:\wwwroot.  The eventual
content of this folder will be images anyway.  Would I need to code an
interceptor to detect 404 error and path to redirect the visitor to
another URL instead of Tomcat's default 404 error?

Thanks for your time,
Tommy

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



Re: virtual directory

2007-04-12 Thread Johnny Kewl


Just thought of a another way to map files... and I think it may work out 
better... but dont ask me how to set it up I've forgotten... because linux 
never breaks.


Try Samba on linux, it allows you to map the linux file system to 
windows.
So the windows guys will be working with files just like they normally do... 
but those files actually live on the linux server now if you symlink on 
linux, windows will just think its the normal file system. I like this more 
because I know it works and it means you also have the test case running on 
linux... ie if you stick tomcat on linux, the changes on windows will just 
happen there as well Samba... its better... no daring technology on MS 
thats always going to be a headache to maintain.



- Original Message - 
From: Johnny Kewl [EMAIL PROTECTED]

To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, April 11, 2007 11:12 PM
Subject: Re: virtual directory


I dont know... I think you have be spoilt by linux   windows shortcuts 
just dont equal linux soft links... hey! :)
I see what you saying even if say you made a little servlet that could 
suck files from anywhere, how does the calling program see shell folders, 
I suppose you could make the URL mimic files like 
http://myMagicFileSucker/filesystem/subfolder but its never going to be 
enough to make a normal java program think its a folder.


I think if you had linux links on windows, it would make you happy... and 
guess what, its possible but MS doesnt advertise it because there are a 
few things a normal user can do that can really screw things up.


Have a look at a free solution and have a look at microsofts solution... 
they call linux links... junction points.


Free solution http://www.rekenwonder.com/linkmagic.htm
Microsoft  http://support.microsoft.com/kb/205524

You will be able to map external folders to a tomcat webapp folder...

I think this is a kludge of last resort and I wouldnt recommend it to any1 
unless there is absolutely no other way.
Make sure your programmers really understand things like if they delete a 
junction point in explorer... weird stuff can happen because the ms file 
explorer doesnt know what these things are.
Whew!... just be careful... I'm thinking about stuff like tomcats auto 
deployment... I mean if that whacks the folders before it makes new ones, 
and it probably does... some programmers files somewhere else will get 
whacked if you drop another WAR file in... ha ha, but then hey I suppose 
that should also happen on linux links... anyway test it carefully.
have fun I'm putting on my bullet proof vest, and changing my 
name... so you will never find me again ha ha.


- Original Message - 
From: Sylvain Roche [EMAIL PROTECTED]

To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, April 11, 2007 4:16 PM
Subject: Re: virtual directory



Hi Johnny, hi everybody

I took the images example to explain and simplify the problem, but 
actually I may need to include different contents, which may be static - 
like images, flash animations, html pages - but may also be jsp pages for 
exemple, and some of these contents are likely to be generated by another 
web application.


This works fine for years with oc4j / orion, so we would rather have the 
lesser to change before we can switch oc4j for tomcat. In fact if we 
can't manage to do that, it may be a reason to discard tomcat from our 
choice list, because some part of our application relies on virtual 
directories.


Best regards

Sylvain

At 10:14 11/04/2007, Johnny Kewl wrote:


Hi sylvian
When developing I do this

request.getContextPath() + uri;

but I wrap the request.getContextPath() in a little routine like say 
imageMap(String uri) and use that in my JSP's


Thats cool because if I change the context path the app doesnt break...

BUT... I do it for a much better reason.

When I'm done making a Tomcat app I move all the images to the Apache 
server...


And then just change imageMap(String uri) to point to the Apache Web 
server url...


Apache Web  Srvr is damn good at delivering images and Tomcat speeds up 
nicely when you do this.


I actually cant believe that people use cross context stuff for 
images if you dont want to use apache, the you could make a single 
webapp, dump all your images in there, and just address that in your 
other apps, http://myImageTomcatServer/image/xxx.jpg


Let the browser join the images for you... if you have a look at web 
pages you will often see the images come from a different server... like 
look at web counters for example.


Heres another example if I make a captcha generator (you know those 
little images that have numbers in them) then I make a seperate servlet 
called CapchaGen.jpg and in my other apps I call that URL image 
appears in the browser.


What document is this that you talking about... sucking images from other 
webApps through context sharing... sounds crazy?


Good luck

Re: virtual directory

2007-04-11 Thread Johnny Kewl


Hi sylvian
When developing I do this

request.getContextPath() + uri;

but I wrap the request.getContextPath() in a little routine like say 
imageMap(String uri) and use that in my JSP's


Thats cool because if I change the context path the app doesnt break...

BUT... I do it for a much better reason.

When I'm done making a Tomcat app I move all the images to the Apache 
server...


And then just change imageMap(String uri) to point to the Apache Web server 
url...


Apache Web  Srvr is damn good at delivering images and Tomcat speeds up 
nicely when you do this.


I actually cant believe that people use cross context stuff for images 
if you dont want to use apache, the you could make a single webapp, dump all 
your images in there, and just address that in your other apps, 
http://myImageTomcatServer/image/xxx.jpg


Let the browser join the images for you... if you have a look at web pages 
you will often see the images come from a different server... like look at 
web counters for example.


Heres another example if I make a captcha generator (you know those 
little images that have numbers in them) then I make a seperate servlet 
called CapchaGen.jpg and in my other apps I call that URL image 
appears in the browser.


What document is this that you talking about... sucking images from other 
webApps through context sharing... sounds crazy?


Good luck



[EMAIL PROTECTED]


- Original Message - 
From: Sylvain Roche [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, April 10, 2007 7:23 PM
Subject: virtual directory



Hi

this seems a very classical problem for tomcat users, but I couldn't find 
on the web a solution which satisfies me.


We plan to host multiple applications, on a tomcat box. These applications 
may all need an images directory. But of course each of them has a 
different images directory.
What we want to do is to deploy different versions of each application, 
without the need to move the images.


The crosscontext context solution, which is the one given everywhere, does 
not correspond to our need, because, as far as I tried it
- I may need an unknow depth for the point I will make the link, for 
example, it could be /images/layout/DE_de
- I need to have a mapping inside my web-app, ie inside the context rather 
than at the same level
- when I read the doc, it seems to me that this is a workaround, a misuse 
of something that was made for being able to dispatch requests to another 
application - what I want is only to link something out of my application 
deployment path as if it was inside. I don't know if it is wise to rely on 
this workaround for long term

- the same mapping (/images) has to be different for each application

basically this is what is performed on Oracle's OC4J with the 
virtual-directory directive, on weblogic with virtual-directory-mapping. 
Actually I found some kind of virtual directory on every j2ee server but 
tomcat. I can't imagine that this problem has no solution other than the 
cross context. I may have missed something, but where ?



Best regards

Sylvain


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





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



Re: virtual directory

2007-04-11 Thread Sylvain Roche

Hi Johnny, hi everybody

I took the images example to explain and simplify the problem, but 
actually I may need to include different contents, which may be 
static - like images, flash animations, html pages - but may also be 
jsp pages for exemple, and some of these contents are likely to be 
generated by another web application.


This works fine for years with oc4j / orion, so we would rather have 
the lesser to change before we can switch oc4j for tomcat. In fact if 
we can't manage to do that, it may be a reason to discard tomcat from 
our choice list, because some part of our application relies on 
virtual directories.


Best regards

Sylvain

At 10:14 11/04/2007, Johnny Kewl wrote:


Hi sylvian
When developing I do this

request.getContextPath() + uri;

but I wrap the request.getContextPath() in a little routine like say 
imageMap(String uri) and use that in my JSP's


Thats cool because if I change the context path the app doesnt break...

BUT... I do it for a much better reason.

When I'm done making a Tomcat app I move all the images to the 
Apache server...


And then just change imageMap(String uri) to point to the Apache Web 
server url...


Apache Web  Srvr is damn good at delivering images and Tomcat speeds 
up nicely when you do this.


I actually cant believe that people use cross context stuff for 
images if you dont want to use apache, the you could make a 
single webapp, dump all your images in there, and just address that 
in your other apps, http://myImageTomcatServer/image/xxx.jpg


Let the browser join the images for you... if you have a look at web 
pages you will often see the images come from a different server... 
like look at web counters for example.


Heres another example if I make a captcha generator (you know 
those little images that have numbers in them) then I make a 
seperate servlet called CapchaGen.jpg and in my other apps I 
call that URL image appears in the browser.


What document is this that you talking about... sucking images from 
other webApps through context sharing... sounds crazy?


Good luck



[EMAIL PROTECTED]


- Original Message - From: Sylvain Roche [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, April 10, 2007 7:23 PM
Subject: virtual directory



Hi

this seems a very classical problem for tomcat users, but I 
couldn't find on the web a solution which satisfies me.


We plan to host multiple applications, on a tomcat box. These 
applications may all need an images directory. But of course each 
of them has a different images directory.
What we want to do is to deploy different versions of each 
application, without the need to move the images.


The crosscontext context solution, which is the one given 
everywhere, does not correspond to our need, because, as far as I tried it
- I may need an unknow depth for the point I will make the link, 
for example, it could be /images/layout/DE_de
- I need to have a mapping inside my web-app, ie inside the context 
rather than at the same level
- when I read the doc, it seems to me that this is a workaround, a 
misuse of something that was made for being able to dispatch 
requests to another application - what I want is only to link 
something out of my application deployment path as if it was 
inside. I don't know if it is wise to rely on this workaround for long term

- the same mapping (/images) has to be different for each application

basically this is what is performed on Oracle's OC4J with the 
virtual-directory directive, on weblogic with 
virtual-directory-mapping. Actually I found some kind of virtual 
directory on every j2ee server but tomcat. I can't imagine that 
this problem has no solution other than the cross context. I may 
have missed something, but where ?



Best regards

Sylvain


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




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



Re: virtual directory

2007-04-11 Thread Hassan Schroeder

On 4/11/07, Sylvain Roche [EMAIL PROTECTED] wrote:


I took the images example to explain and simplify the problem, but


Regardless, I don't understand what you're trying to do --

do you want to have e.g.
   example.com/foo/images
   example.com/bar/images
where 'images' points to the same content?

If so, you could handle that via symlinks. If it's something else, maybe
you can provide a different example...

--
Hassan Schroeder  [EMAIL PROTECTED]

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



Re: virtual directory

2007-04-11 Thread Sylvain Roche
The symlink solution could work, except that it is not what I want to 
do. The production application is hosted on linux servers, but we 
also have to deal with the developpers' computers, which runs windows


What I need basically il to have a subdirectory of my webapp located 
somewhere else on my disk

ie
app = /srv/webapp/myapp
  META-INF
  WEB-INF
  classes
  lib
  publication   = /srv/webapp/publication
  images
  resources = /srv/webapp/resources
  index.jsp
...

where /srv/webapp/publication and /srv/webapp/resources are not 
really subdirectories of /srv/webapp/myapp, but are seen like they 
were by the application


Actually on oc4j, I can get the real path with 
ServletContext.getRealPath(String path); where path is for example 
/WEB-INF/publication






At 17:09 11/04/2007, Hassan Schroeder wrote:

On 4/11/07, Sylvain Roche [EMAIL PROTECTED] wrote:


I took the images example to explain and simplify the problem, but


Regardless, I don't understand what you're trying to do --

do you want to have e.g.
   example.com/foo/images
   example.com/bar/images
where 'images' points to the same content?

If so, you could handle that via symlinks. If it's something else, maybe
you can provide a different example...

--
Hassan Schroeder  [EMAIL PROTECTED]

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



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



Re: virtual directory

2007-04-11 Thread Hassan Schroeder

On 4/11/07, Sylvain Roche [EMAIL PROTECTED] wrote:

The symlink solution could work, except that it is not what I want to
do. The production application is hosted on linux servers, but we
also have to deal with the developpers' computers, which runs windows


That's fixable :-)


What I need basically il to have a subdirectory of my webapp located
somewhere else on my disk


Given that webapps are supposed to be self-contained, I'm not
surprised Tomcat doesn't provide such a facility...


Actually on oc4j


..nor am I surprised that oc4j does, but let's not go there :-)

If it were me, I'd consider just using your build system to make copies
of those directories, in the short term at least.

Good luck,
--
Hassan Schroeder  [EMAIL PROTECTED]

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



Re: virtual directory

2007-04-11 Thread Johnny Kewl
I dont know... I think you have be spoilt by linux   windows shortcuts 
just dont equal linux soft links... hey! :)
I see what you saying even if say you made a little servlet that could 
suck files from anywhere, how does the calling program see shell folders, I 
suppose you could make the URL mimic files like 
http://myMagicFileSucker/filesystem/subfolder but its never going to be 
enough to make a normal java program think its a folder.


I think if you had linux links on windows, it would make you happy... and 
guess what, its possible but MS doesnt advertise it because there are a few 
things a normal user can do that can really screw things up.


Have a look at a free solution and have a look at microsofts solution... 
they call linux links... junction points.


Free solution http://www.rekenwonder.com/linkmagic.htm
Microsoft  http://support.microsoft.com/kb/205524

You will be able to map external folders to a tomcat webapp folder...

I think this is a kludge of last resort and I wouldnt recommend it to any1 
unless there is absolutely no other way.
Make sure your programmers really understand things like if they delete a 
junction point in explorer... weird stuff can happen because the ms file 
explorer doesnt know what these things are.
Whew!... just be careful... I'm thinking about stuff like tomcats auto 
deployment... I mean if that whacks the folders before it makes new ones, 
and it probably does... some programmers files somewhere else will get 
whacked if you drop another WAR file in... ha ha, but then hey I suppose 
that should also happen on linux links... anyway test it carefully.
have fun I'm putting on my bullet proof vest, and changing my 
name... so you will never find me again ha ha.


- Original Message - 
From: Sylvain Roche [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, April 11, 2007 4:16 PM
Subject: Re: virtual directory



Hi Johnny, hi everybody

I took the images example to explain and simplify the problem, but 
actually I may need to include different contents, which may be static - 
like images, flash animations, html pages - but may also be jsp pages for 
exemple, and some of these contents are likely to be generated by another 
web application.


This works fine for years with oc4j / orion, so we would rather have the 
lesser to change before we can switch oc4j for tomcat. In fact if we can't 
manage to do that, it may be a reason to discard tomcat from our choice 
list, because some part of our application relies on virtual directories.


Best regards

Sylvain

At 10:14 11/04/2007, Johnny Kewl wrote:


Hi sylvian
When developing I do this

request.getContextPath() + uri;

but I wrap the request.getContextPath() in a little routine like say 
imageMap(String uri) and use that in my JSP's


Thats cool because if I change the context path the app doesnt break...

BUT... I do it for a much better reason.

When I'm done making a Tomcat app I move all the images to the Apache 
server...


And then just change imageMap(String uri) to point to the Apache Web 
server url...


Apache Web  Srvr is damn good at delivering images and Tomcat speeds up 
nicely when you do this.


I actually cant believe that people use cross context stuff for images 
if you dont want to use apache, the you could make a single webapp, dump 
all your images in there, and just address that in your other apps, 
http://myImageTomcatServer/image/xxx.jpg


Let the browser join the images for you... if you have a look at web pages 
you will often see the images come from a different server... like look at 
web counters for example.


Heres another example if I make a captcha generator (you know those 
little images that have numbers in them) then I make a seperate servlet 
called CapchaGen.jpg and in my other apps I call that URL image 
appears in the browser.


What document is this that you talking about... sucking images from other 
webApps through context sharing... sounds crazy?


Good luck



[EMAIL PROTECTED]


- Original Message - From: Sylvain Roche [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, April 10, 2007 7:23 PM
Subject: virtual directory



Hi

this seems a very classical problem for tomcat users, but I couldn't find 
on the web a solution which satisfies me.


We plan to host multiple applications, on a tomcat box. These 
applications may all need an images directory. But of course each of them 
has a different images directory.
What we want to do is to deploy different versions of each application, 
without the need to move the images.


The crosscontext context solution, which is the one given everywhere, 
does not correspond to our need, because, as far as I tried it
- I may need an unknow depth for the point I will make the link, for 
example, it could be /images/layout/DE_de
- I need to have a mapping inside my web-app, ie inside the context 
rather than

RE: Virtual Directory

2006-02-08 Thread Caldarale, Charles R
 From: sumesh [mailto:[EMAIL PROTECTED] 
 Subject: Virtual Directory
 
 How can I create a Virtual Directory in Apache Tomcat? I have
 installed tomcat in C:\Program Files\Apache Group\Tomcat 4.1 and I
 have some Tutorials in E:\Tutorial .I want to publish the same using
 the same Web Server.How can I do that

You could start by actually reading the answers that have been posted
during the last couple of days.  Sending the same message four times is
rather annoying, more so when you've already been given the answer.

 - 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Virtual Directory

2006-02-08 Thread sumesh

Tim Lucia wrote:


Add a file, Tutorial.xml, to your C:\Program Files\Apache Group\Tomcat
4.1\webapps\ directory.  It should contain at least the following:

context docBase=E:\Tutorial...

Please read here:

http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html


-Original Message-
From: sumesh [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 05, 2006 10:48 AM

To: Tomcat Users List
Subject: Virtual Directory


Dear friends,
   How can I create a Virtual Directory in Apache Tomcat? I have 
installed tomcat in C:\Program Files\Apache Group\Tomcat 4.1 and I 
have some Tutorials in E:\Tutorial .I want to publish the same using 
the same Web Server.How can I do that



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 


when I created the Tutorial.xml file I get some error while starting tomcat


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Virtual Directory

2006-02-08 Thread Tim Lucia
Sorry, I did not read the version.  Try this:

http://tomcat.apache.org/tomcat-4.1-doc/appdev/deployment.html

(Basically, I believe you need to add a context docBase=E:/Tutorial
path=tutorial.../ to server.xml

Tim


-Original Message-
From: sumesh [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 08, 2006 10:40 AM
To: Tomcat Users List
Subject: Re: Virtual Directory


Tim Lucia wrote:

Add a file, Tutorial.xml, to your C:\Program Files\Apache Group\Tomcat 
4.1\webapps\ directory.  It should contain at least the following:

context docBase=E:\Tutorial...

Please read here:

http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html


-Original Message-
From: sumesh [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 05, 2006 10:48 AM
To: Tomcat Users List
Subject: Virtual Directory


Dear friends,
How can I create a Virtual Directory in Apache Tomcat? I have
installed tomcat in C:\Program Files\Apache Group\Tomcat 4.1 and I 
have some Tutorials in E:\Tutorial .I want to publish the same using 
the same Web Server.How can I do that


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  

when I created the Tutorial.xml file I get some error while starting tomcat


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Virtual Directory

2006-02-07 Thread Caldarale, Charles R
 From: sumesh [mailto:[EMAIL PROTECTED] 
 Subject: Virtual Directory
 
 How can I create a Virtual Directory in Apache Tomcat? I have
 installed tomcat in C:\Program Files\Apache Group\Tomcat 4.1 and I
 have some Tutorials in E:\Tutorial .I want to publish the same using
 the same Web Server.How can I do that

If you're just starting out with Tomcat, you should probably use the
current version (5.5.15) rather than something that's over a year old
and does not implement the current servlet spec.  It's also risky to
install Tomcat in a directory path with spaces in the names - creates
confusion for lots of programs and scripts.

With the current Tomcat level, create a file called
[desired_app_name].xml in the conf/Catalina/localhost directory.  Within
that file, put in a Context tag with the docBase attribute set to
E:\Tutorial.  You should now be able to reference the tutorial pages
via the URI:
http://[your_site_name]/[desired_app_name]/[page_name].html

I've never used 4.1, so I don't know if the above is applicable to that
level.  You may have to put your Context tag inside conf/server.xml
instead, and you will then need a path attribute to specify
[desired_app_name].  Take a look at:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
http://tomcat.apache.org/tomcat-4.1-doc/config/context.html

 - 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Virtual Directory

2006-02-06 Thread Tim Lucia
Add a file, Tutorial.xml, to your C:\Program Files\Apache Group\Tomcat
4.1\webapps\ directory.  It should contain at least the following:

context docBase=E:\Tutorial...

Please read here:

http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html


-Original Message-
From: sumesh [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 05, 2006 10:48 AM
To: Tomcat Users List
Subject: Virtual Directory


Dear friends,
How can I create a Virtual Directory in Apache Tomcat? I have 
installed tomcat in C:\Program Files\Apache Group\Tomcat 4.1 and I 
have some Tutorials in E:\Tutorial .I want to publish the same using 
the same Web Server.How can I do that


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]