Hi.
Don't like top-posting, but if you all do it..

I see a difference between this :
..
for (String fileName : new File("\\\\server\\share").list()) {
..

and this :

<Context path="/pictures" docBase="\\storage\share\pictures"  />

in terms of how many backslashes are used. I am not quite sure if and how backslashes are being escaped/unescaped on the way from the xml config file into a Java string in the Tomcat-level docbase, but maybe you want to try this :

<Context path="/pictures" docBase="\\\\storage\\share\\pictures"  />

?






Alexander Diedler wrote:
Yes,
http://www.test.de/pictures/test.png throws 404 error.

Alex


-----Ursprüngliche Nachricht-----
Von: Daniel Mikusa [mailto:dmik...@vmware.com] Gesendet: Dienstag, 15. November 2011 15:13
An: Tomcat Users List
Betreff: RE: Include NEtwork path into Tomcat - urgent


Not sure Java IO supports windows UNC.

A quick test worked for me.  I was able to list the contents of a SMB share on 
my network.  Windows XP, Java 1.6.0_29.

public class Test {
  public static void main(String[] args) {
    for (String fileName : new File("\\\\server\\share").list()) {
      System.out.println(fileName);
    }
  }
}

Maybe try running a quick test like this from your machine?


but it throws a 404 error if I test it.

How are you testing it?  Are you directly accessing a file on that share or are 
you trying to get a directory listing?  By default, Tomcat will not display a 
directory listing (it'll display a 404 error).

Dan




On Tue, 2011-11-15 at 05:48 -0800, Ilya Kazakevich wrote:
You need user ssesion to access windows station via SMB anyway. You can set this script as "log in script" using group policies in windows for the user your tomcat runs as.



Ilya Kazakevich,
Developer
JetBrains Inc
http://www.jetbrains.com
"Develop with pleasure!"

-----Original Message-----
From: Alexander Diedler [mailto:adied...@tecracer.de]
Sent: Tuesday, November 15, 2011 5:39 PM
To: Tomcat Users List
Subject: AW: Include NEtwork path into Tomcat - urgent

Hello,
This is no option, this solution means, that the windows session must still remain opened with a logged in user.

Alex
-----Ursprüngliche Nachricht-----
Von: Ilya Kazakevich [mailto:ilya.kazakev...@jetbrains.com]
Gesendet: Dienstag, 15. November 2011 14:32
An: 'Tomcat Users List'
Betreff: RE: Include NEtwork path into Tomcat - urgent

Not sure Java IO supports windows UNC.
Try to do the following: 1) mount this share as disk: (in cmd type "net use z:
\\storage\share\pictures")
2) configure tomcat to work with "z:\"
Ilya Kazakevich,
Developer
JetBrains Inc
http://www.jetbrains.com <http://www.jetbrains.com/> "Develop with pleasure!"


  _____

From: Alexander Diedler [mailto:adied...@tecracer.de]
Sent: Tuesday, November 15, 2011 5:27 PM
To: users@tomcat.apache.org
Subject: Include NEtwork path into Tomcat - urgent



Hello,

I have a Tomcat 6.0 application, that references their pictures as http://www.test.de/pictures/test.png.

/pictures is a network path on a storage, so I try to make it as a Context within the server.xml Host Tag

<Context path="/pictures" docBase="\\storage\share\pictures" /> but it throws a 404 error if I test it. Has somebody any idea to get out of this troube?

Greetings

Alexander



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



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

Reply via email to