Struts / tomcat 5.5 / File problem
- From: "Tom Vercauteren via JavaKB.com" <forum@xxxxxxxxxxxxxxxxx>
- Date: Tue, 31 May 2005 08:16:53 GMT
Hello,
I'm just starting with struts, with the book : Struts in action.
I use some classes from this book, and in one of them, there is a problem
in my environment. (jdk 1.4.2_08, tomcat 5.5.9, struts 1.0.2)
The application is a simple registerpage, where a user must give in a name,
and twice the same password. The name & pw will be stored in a
propertiesfile on the server.
In one of the classes, we gone get the path to the propertiesfile with
following code :
String file = this.getClass().getClassLoader().getResource
(UserDirectoryFile).getFile();
outputstream = new FileOutputStream(o);
But this isn't working.
The value of file is : "C:/Program%20Files/Apache%20Software%
20Foundation/Tomcat%205.5/webapps/register/WEB-
INF/classes/resources/users.properties"
When i do : file = file.replaceAll("%20", " ");
Then my code works.
Isn't there any other solution to this problem? (where my code can
understand %20 as spaces?)
Thanks in advance,
Tom
--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200505/1
.
- Follow-Ups:
- Re: Struts / tomcat 5.5 / File problem
- From: Tom Dyess
- Re: Struts / tomcat 5.5 / File problem
- Prev by Date: Struts and javascript
- Next by Date: Re: An interview question
- Previous by thread: Struts and javascript
- Next by thread: Re: Struts / tomcat 5.5 / File problem
- Index(es):