• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to read a file from a JSF Controller ?

 
Daniel Breitner
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
vikas bala
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Daniel Breitner
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic