tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "NanFei Wang" <nanfeiw...@hotmail.com>
Subject Re: Network Disk Not Exist Under Tomcat-5.5.9
Date Thu, 05 May 2005 05:42:29 GMT
Hi, Jason
Would you please to give me a sample code in a *.jsp file
to show how to use \\machinename\sharename

I try to use my test.jsp file as follow
-------------------------------
<%@ page language="java" contentType="text/html;charset=Big5" %>
<%
  String uncPath="\\\\remotehostname\\sharedname";
  java.io.File uncPathF= new java.io.File(uncPath);
  out.print("<br>");
  out.println(uncPath+" exists()="+uncPathF.exists());
%>
-------------------------------
I get: \\remotehostname\sharedname exists()=false
In my Api, I really need to access the 'shareDirectory' in other computers
over network .


If my test.jsp(where 'Y' is mapped) with follow:
-----------------------------------
<%@ page language="java" contentType="text/html;charset=Big5" %>
<%
String netWorkDisk="Y:\\";
java.io.File netWorkDiskF= new java.io.File(netWorkDisk);
out.println(netWorkDisk+" exists()="+netWorkDiskF.exists());
%>
-----------------------------------
If I use Tomcat-5.0.18 working in Window2000 and start by startup.bat in
another Dos Window after log-in with administrator,
then the test.jsp will get Y:\ exists()=true

If I use Apache Tomcat-5.5.9 which will give web 'Service' automatically,
(no matter if I log-in with administrator or not log-in)
then the test.jsp will get Y:\ exists()=false;

Please advise
Regards

- NanFei








----- Original Message ----- 
From: "Jason Bainbridge" <jbainbridge@gmail.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Thursday, May 05, 2005 10:04 AM
Subject: Re: Network Disk Not Exist Under Tomcat-5.5.9


On 5/4/05, NanFei Wang <nanfeiwang@hotmail.com> wrote:
> Dear Jason:
> You are right :
>     -------------
>     Uhm you don't want to do that, running any service as Administrator is
>     just asking for trouble.
>     You want a dedicated service account for tomcat, there were some posts
>     about the pernissions and privileges required for such an account a
>     while back.
>      ---------------
>
> I use Apache Tomcat-5.5.9 which will give web service automatically.
> My solution can only solve the 'network disk' mapping only to some
> 'shareFile' at server side .
> For the 'network disk' mapping to other 'shareFile' over the network, it
is
> in failure !
> I really need to access the 'shareFile' in other computers over network in
> my Api.

Run it under an account that has network privileges and access to the
share and acces the share by using the UNC path in the format:

\\machinename\sharename

Regards,
-- 
Jason Bainbridge
http://kde.org - webmaster@kde.org
Personal Site - http://jasonbainbridge.com

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


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


Mime
View raw message