Is there a tutorial on how to load a properties file in JSP?
I've spent like 2 days on this and I cant even figure out how load the
stupid file using JSP.
Andrew Thompson - 01 Sep 2006 21:15 GMT
> Is there a tutorial on how to load a properties file in JSP?
Can you load it in core Java?
> I've spent like 2 days on this and I cant even figure out how load the
> stupid
Files are not stupid, ...
>...file using JSP.
..and yet you could wait no more than 6 hours before
reposting your ..question.
Please refrain from doing that* in future.
* Putting the same thread under two different titles,
as well as being so impatient.
Andrew T.
Thomas Kellerer - 01 Sep 2006 21:52 GMT
RigasMinho wrote on 01.09.2006 21:55:
> Is there a tutorial on how to load a properties file in JSP?
>
> I've spent like 2 days on this and I cant even figure out how load the
> stupid file using JSP.
Well you obviously did not read the Javdocs for the class Properties very
carefully then. Otherwise you had noticed:
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#load(java.io.I
nputStream)
If you wonder how to create an InputStream I recommend the Javadocs for that:
http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html
Which will lead you (after some clever thinking) to:
http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileInputStream.html
Then you are all set.
If you still don't know how to load them, I recommend the tutorial at Sun's website:
http://java.sun.com/docs/books/tutorial/essential/TOC.html
especially:
http://java.sun.com/docs/books/tutorial/essential/io/index.html
and
http://java.sun.com/docs/books/tutorial/essential/environment/properties.html
Thomas
RigasMinho - 05 Sep 2006 14:09 GMT
I got it to work but only in a java file.
for the JSP part i cant get it to do anything w/ the same code.
> RigasMinho wrote on 01.09.2006 21:55:
> > Is there a tutorial on how to load a properties file in JSP?
[quoted text clipped - 26 lines]
>
> Thomas