Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

How to Load Properties File?

Thread view: 
RigasMinho - 01 Sep 2006 20:55 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.