Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

project file structure for web application (war).

 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am not sure whether my web applicaition project is correct or not.
After deployed my EAR file to jboss 6.0, I don't see my xhtml web page is picking up css and js files. The web applicaiton (client) has all the js, css and xhtml pages bundled. primefaces 2.2.1 is also bundled in the war project.

Here is my war project stucture:

Web Pages
- WEB-INF
- resources
|- css
|- images
|- scripts
- templates
|- layout-with-right-left.xhtml
- index.html

Here is my index.xhtml file:



Here is layout_with_right_left.xhtml:



is the line path "/WEB-INF/templates/layout_with_right_left.xhtml" and /WEB-INF/resources/css/style.css defined correctly in my above xhtml files?

Thank you advance for any suggestion.

Thanks
Sam
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do not place your resources under WEB-INF. The browser will not be able to access them from there. No app server will server any files from within the WEB-INF directory.
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:Do not place your resources under WEB-INF. The browser will not be able to access them from there. No app server will server any files from within the WEB-INF directory.


Hello, thank you for your response.
I have moved the "resources" and "templates" folders to "web" like this:

web
-- WEB-INF
-- templates
|-- layout_with_right_left.xhtml
-- resources
|-- css
|-- images
|-- scripts
-- index.xhtml

Now I changed my xhtml like this:

layout_with_right_left.xhtml:



index.xhtml:


After deployed the file, browsed to the index.xhtml page, I still can't see the styles applied to the xhtml page.
I have verified that the xhtml files are updated in the jboss server tmp directory.

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are going to post your questions on multiple forums, you should also post your solution in all of the forums.
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the not posting my answers to this forum.
The answer is I a missing web.xml (with facelets definition) in the project, which is same as when I had the problem with getting the naming object not found exception when invoke the Facade bean object from client.

Thanks
Sam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic