Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can webapp docbase point to a mapped drive?

Status
Not open for further replies.

Docdude

Programmer
Nov 14, 2002
2
US
How can I point my web app's context docbase to a mapped drive?
either using mapped drive letter, or the fully qualified address:
<Context path="/pictures" docBase="G:\" />
or
<Context path="/pictures" docBase="\\fileserver\pics\" />
Neither seem to work for me.

I have tried this by starting up tomcat via the tomcat monitor, and specifying an administrator account.

Authority is probably NOT the problem, as \\fileserver\pics\ is a publicly accessibly file share with NO authentication required.

Also I DID put my context xml file under the
"C:\Tomcat 5.0\conf\Catalina\localhost" folder.
Thank you
Michael Dockery
 
Michael,

If your webapp is called "pictures", and you are mapping to a UNC drive such as "\\fileserver\pics\", then your webapp must exist in a directory named "\\fileserver\pics\pictures", or a war file : "\\fileserver\pics\pictures.war" - is this the case ?

There must also be a directoy named "\\fileserver\pics\pictures\WEB-INF", and web.xml must also be present (or both within pictures.war)

Do you have all these elements ?


--------------------------------------------------
Free Database Connection Pooling Software
 
I appreciate your feedback/suggestions.

In this case, all I want to do is list the files in the mapped drive on the webpage.

When I tried this on Tomcat 5.0.28, it does NOT work.

When I tried this on tomcat 5.0.25, it worked fine.

...i did not need a folder with same name as the webapp
(ie: \\fileserver\pics\pictures)
...nor did I need the WEB-INF
(ie: \\fileserver\pics\pictures\WEB-INF)


Is 5.0.28 more strict than 5.0.25 regarding webapp docbases?


thank you


 
The servlet spec does suggest that you need the elements I suggested - does it work OK if you add them ?

Or maybe if you have this :

<Context path="/pics" docBase="\\fileserver\" />

Does that work ?



--------------------------------------------------
Free Database Connection Pooling Software
 
OK, just tried the following :

<Context path="/bla" docBase="C:\java" />

In 5.0.25 & also 5.0.28 , accessing successfully lists the directory of C:\java (and no folder called "bla" exists). Frankly I'm surprised it did !

In any case, I would try a similar test on your local drive. It seems like it could be a file system problem rather than a tomcat error ...

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top