File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes project file structure for web application (war). Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "project file structure for web application (war)." Watch "project file structure for web application (war)." New topic
Author

project file structure for web application (war).

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
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

Joined: May 14, 2008
Posts: 5823
    
    7

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.


JBoss In Action
sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
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

Joined: May 14, 2008
Posts: 5823
    
    7

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

Joined: Feb 18, 2011
Posts: 208
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
 
 
subject: project file structure for web application (war).