How to Load Properties File?

R

RigasMinho

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.
 
A

Andrew Thompson

RigasMinho said:
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.
 
T

Thomas Kellerer

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.InputStream)

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
 
R

RigasMinho

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top