Thanks ORG. The ServletContext method solved my problem.
Rajendra
On 3/10/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi Rajendra,
This also confused the hell out of me.
Here are some tips
If a url is relative, its relative to the page
eg
moreInfo/Details/SomePage.htm
So its going to
Hi Rajendra,
This also confused the hell out of me.
Here are some tips
If a url is relative, its relative to the page
eg
moreInfo/Details/SomePage.htm
So its going to depend on the page the user is viewing and go from there...
just like normal HTML pages.
When you want it to go to an
Hi,
I am using TOMCAT 5.5. I am creating a file in class that is called from a
JSP. However, the relative path that I have specified in the class doesn't
seem to work. The path that I have used is
:/webapps/Jonathon/WEB-INF/etc/subscriber.txt.
Can someone please let me know, what is wrong
Rajendra Sakpal wrote:
Hi,
I am using TOMCAT 5.5. I am creating a file in class that is called from a
JSP. However, the relative path that I have specified in the class doesn't
seem to work. The path that I have used is
:/webapps/Jonathon/WEB-INF/etc/subscriber.txt.
Can someone please let
(Please reply to the list only, I don't need to get the message twice.)
Rajendra Sakpal wrote:
Am I right to say that / refers to the Tomcat directory ?
No, you're wrong. Attempting to access / would result in an attempt to
write to the root of the filesystem.
If I mention the file path
Hi Peter,
Thanks for your reply. Here are few more things in the context of the
relative path:
1. I am gathering that / refers to the drive where my Tomcat is installed
on Windows. (With file path as /subscribers.txt the file is created at
the root of the drive.)
2. I am not using HTTP
Am I right to say that / refers to the Tomcat directory ?
If I mention the file path as /subscribers.txt, I don't find the file in
the TOMCAT directory once the class is instantiated.
regards,
Rajendra
On 3/1/07, Pid [EMAIL PROTECTED] wrote:
Rajendra Sakpal wrote:
Hi,
I am using
Hi Peter,
1. You are right: / refers to the root of file system.
2. What is the right way to make Tomcat write a file in the directory
: /webapps/Jonathon/WEB-INF/etc/subscriber.txt ?
I want to avoid specifying an absolute path to the file in my code.
Rajendra
On 3/1/07, Pid [EMAIL
It's Pid, and PLEASE stop sending 2 emails, you only need reply to the list.
I gave you an answer, in my first reply.
Acquire the ServletContext, and use that to obtain a usable path from
the webapp relative path you start with.
In a Servlet you can acquire the context from the
From: Rajendra Sakpal [mailto:[EMAIL PROTECTED]
What is the right way to make Tomcat write a file in the directory
: /webapps/Jonathon/WEB-INF/etc/subscriber.txt ?
Use servletContext.getRealPath(/WEB-INF/etc/subscriber.txt). However,
you should not be writing files in your webapp directory;
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Peter,
Peter Crowther wrote:
From: Rajendra Sakpal [mailto:[EMAIL PROTECTED]
What is the right way to make Tomcat write a file in the directory
: /webapps/Jonathon/WEB-INF/etc/subscriber.txt ?
Use
Rajendra Sakpal wrote:
1. I am gathering that / refers to the drive where my Tomcat is
installed on Windows. (With file path as /subscribers.txt the file is created at
the root of the drive.)
That's right:
1. **there is no special meaning for /**.
It's as if you went into a command-line
12 matches
Mail list logo