aspose file tools*
The moose likes JSF and the fly likes How to read a file from a JSF Controller ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to read a file from a JSF Controller ?" Watch "How to read a file from a JSF Controller ?" New topic
Author

How to read a file from a JSF Controller ?

Daniel Breitner
Ranch Hand

Joined: Nov 13, 2008
Posts: 70
Hello everybody,

I have the following problem:

I have a file that I want to read (config.xml).
It lies within my WEB-INF folder but I don�t know how to get the path to access it.

Who can help me ?

With kind regards

Daniel Breitner


Visit me at http://liferay-blogging.blogspot.com
vikas bala
Greenhorn

Joined: Dec 26, 2006
Posts: 19
Hello Dan,
I guess you are referring to the faces-config.xml in the WEB-INF folder.
If yes to read that you need mark the following entry in your deployment descriptor (web.xml).
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>

Does that helps?


Thanks
Vikas


hugs <br />Vikas
Daniel Breitner
Ranch Hand

Joined: Nov 13, 2008
Posts: 70
Hi - thanks for your answer,

but I meant any file within my WEB-INF folder.

I just want to have something that gives me the full qualified path in the file system to my file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to read a file from a JSF Controller ?
 
Similar Threads
reading a properties file from the war file
RandomAccessFile
LDF File
Binary
How To Read a JSP from a JAR File