How to handle Not Found in ExternalContext as a Resource?
puradawid Oct 20, 2014 6:34 AMHello everyone!
I have a problem with my existing maven EAR project. I decided to add some JSF (anyway, any html compontent, cause recenlty i'm using webservice only with this project). I configure web descriptor:
<?xml version="1.0" encoding="UTF-8"?> <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> <context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>/WEB-INF/faces-config.xml</param-value> </context-param> <context-param> <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>com.sun.faces.allowTextChildren</param-name> <param-value>true</param-value> </context-param> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.xhtml</url-pattern> <url-pattern>/faces/*</url-pattern> </servlet-mapping> </web-app>
Create faces-config.xml as well:
<?xml version="1.0"?> <faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"> <application /> </faces-config>
I want to mention that webservice isn't configured at all at web.xml descriptor, but it's working well.
Also i had a problem with loading JSF page at all related to problem Must call associate() before calling activate() GateIn 3.4.0/AS7 & PortletBridge 3.0.0 but i removed beans.xml from ejb module file and everything looks okay, i think .
Anyway, i don't know what is cause of problem.
Tree of my project:
./BlinkLink-web/src ├── main │ ├── java │ │ └── pl │ │ └── edu │ │ └── pb │ │ └── blinklink │ │ └── webservice │ │ ├── BlinkLinkService.java │ │ ├── handlers │ │ │ └── LoginHandler.java │ │ ├── login-handler.xml │ │ └── model │ │ ├── BlinkGroupWebservice.java │ │ ├── BlinkUserWebservice.java │ │ ├── LinkWebservice.java │ │ ├── package-info.java │ │ ├── RateWebservice.java │ │ └── UserLinkWebservice.java │ └── webapp │ ├── problem.html │ ├── Test.xhtml │ └── WEB-INF │ ├── faces-config.xml │ ├── jboss-web.xml │ └── web.xml └── test ├── java │ └── pl │ └── edu │ └── pb │ └── blinklink │ └── webservice │ └── BlinkLinkServiceTest.java └── resources └── arquillian.xml
jboss-web.xml:
<?xml version="1.0" encoding="UTF-8"?> <jboss-web> <context-root/> </jboss-web>
Added any static element to webapp folder causing only 404 error, i can't get to this resources by browser.
Please, help me, i would be grateful.
Thanks,
Dawid.