I am using openlayers, query ,query ui for my new project. I have included the js file using :
<ui:define name="content">
<h:outputScript name="/js/openlayers/OpenLayers.js"/>
<h:outputStylesheet name="/css/jquery-ui-1.8.22.custom.css" ></h:outputStylesheet>
<h:outputStylesheet name="/js/jquery/css/jquery_table.css" ></h:outputStylesheet>
<h:outputStylesheet name="/js/jquery/css/modal.css" ></h:outputStylesheet>
<h:outputScript name="/js/jquery/jquery.js"/>
<h:outputScript name="/js/jquery/jquery-ui-1.8.22.custom.min.js"/>
</ui:define name="content">
This is the code in body:
<h:body>
<ui:insert name="content">Content</ui:insert>
</h:body>
Although Openlayers and jquery as showin in rendered html:
is loaded all the style is not loaded and the following error message pops up in firebug console:
"NetworkError: 404 - http://localhost:8282/ProjectX/GISPages/Alarms/theme/default/style.css"
style.css
"NetworkError: 404 - http://localhost:8282/ProjectX/GISPages/Alarms/img/west-mini.png"
west-mini.png
"NetworkError: 404 - http://localhost:8282/ProjectX/GISPages/Alarms/img/east-mini.png"
east-mini.png
"NetworkError: 404 - http://localhost:8282/ProjectX/GISPages/Alarms/img/north-mini.png"
north-mini.png
"NetworkError: 404 - http://localhost:8282/ProjectX/GISPages/Alarms/img/zoom-plus-mini.png"
zoom-p...ini.png
"NetworkError: 404 - http://localhost:8282/ProjectX/GISPages/Alarms/img/south-mini.png"
Also not able to load jquery images:
"NetworkError: 404 - http://localhost:8282/ProjectX/javax.faces.resource/css/images/ui-bg_glass_75_e6e6e6_1x400.png"
ui-bg_...400.png
"NetworkError: 404 - http://localhost:8282/ProjectX/javax.faces.resource/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png"
ui-bg_...100.png
"NetworkError: 404 - http://localhost:8282/ProjectX/javax.faces.resource/css/images/ui-icons_888888_256x240.png"
I am able to load images the png using:
http://localhost:8282/ProjectX/javax.faces.resource/css/images/ui-bg_glass_75_e6e6e6_1x400.png.xhtml
Also, I can see style using:
http://localhost:8282/ProjectX/javax.faces.resource/js/openlayers/theme/default/style.css.xhtml
When I include this style(style.css) manually using openlayers tries to load again rendering error. How is it possible to store openlayer, jquery images and extra files like css,images without altering path?
fig: my resource folder structure
Edit:
After Adding URL pattern and omnifaces:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
<url-pattern>/javax.faces.resource/*</url-pattern>
<url-pattern>/rfRes/*</url-pattern>
</servlet-mapping>
I get error :
"NetworkError: 404 - http://localhost:8282/ProjectX/GISPages/Alarms/RES_NOT_FOUND"
RES_NOT_FOUND
"NetworkError: 500 - http://localhost:8282/ProjectX/rfRes/datatable.ecss?db=eAG7mShzEgAFjAIg&ln=org.richfaces"