T
Tom Vercauteren via JavaKB.com
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
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