hi, there
I think I still got problems in getting real path in servlet.

for example, my servlet is in 127.0.0.1/appsclass/org.apps.Submit (real path
is /home/admin/appsclass/) , and I have a file is in
127.0.0.1/apps/conf/ecareer.conf (real path is /home/admin/apps/conf),

1.when I want to read a file in servlet, is it possible to just set a
virtual paht of a file?like as
File filename=new File("../../../apps/conf/ecareer.conf");
or I must set path to
File filename=new File("/home/apps/conf/ecareer.conf");

2.if can' t use virtual path directly, how can I get real path in a servlet?
can I get real path in org.apps.Submit using
"../../../apps/conf/ecareer.conf" ?

need your helps, thanks a lot.

sincerely
sun

> ----------
> From:         Tim Panton - Westhawk Ltd[SMTP:[EMAIL PROTECTED]]
> Reply To:     A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology.
> Sent:         Friday, January 14, 2000 9:43 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: relative path in servlet
>
> Sun JunXu <[EMAIL PROTECTED]> wrote:
> __________
> >thanks,
> >it doesn't work. getRealPath(String) cann't return any path.
> >and what I want is read from a normal virtual directory on webserver into
> a
> >servlet mounted directory, is there other way?
> >
> >thank you very much.
>
> Yes, from memory I think i used
> this.getClass().getResourceAsStream("../apps/file.txt")
>
> T.
> URL http://www.westhawk.co.uk/
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to