1

I want to dynamically add new .xhtml files in the webapp folder of my project. It only works when i give the full path like,

FileWriter fw = new FileWriter("D:/projects/UIBindingExample/src/main/webapp/pagefour.xhtml");
            fw.write("<html>...some code....</html>");

            fw.close();

instead of this i want to get it work using the relative path of the file like,

src/main/webapp/pagefour.xhtml

i tried this.but its not working .!!! what should i do? Thanks in adv.

Abin Manathoor Devasia
  • 1,945
  • 2
  • 21
  • 47
  • Read this: http://stackoverflow.com/questions/8885201/primeface-update-after-upload/8889096#8889096 – BalusC Jan 19 '12 at 13:09

1 Answers1

0

src/main/webapp/pagefour.xhtml is a relative path to the context of your webapp, so probably if you run this code you would end up in saving file contents to D:/projects/UIBindingExample/target/your-artifact-name/WEB-INF/main/webapp/pagefour.xhtml

where your-artifact-name is name of generated WAR file.

Hope that helps.

ŁukaszBachman
  • 33,595
  • 11
  • 64
  • 74