Question

I just added jstl-1.2.jar, JSF api, and impl jars to my library so that this could work on my jsf xhtml file.

<h:selectOneMenu value="#{qcFormBean.dliStickerValue}">
    <f:selectItem itemValue="P" itemLabel="Pass or Not applicable" />
    <f:selectItem itemValue="M" itemLabel="FAIL-Mechanical" />
    <f:selectItem itemValue="E" itemLabel="FAIL-Electrical" />
    <f:selectItem itemValue="C" itemLabel="FAIL-Cosmetic" />
    <f:selectItem itemValue="S" itemLabel="FAIL-Software" />
    <f:ajax event="change" execute="@this" render="perfbyDliSticker" />
</h:selectOneMenu>

<h:panelGroup id="perfbyDliSticker">
    <h:selectOneMenu value="#{qcFormBean.performedByRoleID}"
                     rendered="#{!qcFormBean.dliStickerValue eq  'P'}">
        <f:selectItem itemValue="A" itemLabel="Always" />                
        <f:selectItem itemValue="O" itemLabel="Often" />
        <f:selectItem itemValue="S" itemLabel="Seldom" />                
    </h:selectOneMenu>
</h:panelGroup>

Now when i try to access the page on IE i get a 404 missing error and i get the following error on Tomcat and i am not sure what to do at this point the error mentions it as a jsp file and i know i am making this as a jsf file so i am not sure what to do.

Feb 05, 2014 3:05:50 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource WARNING: JSF1064: Unable to find or serve resource, /preQcFormDean.xhtml.

Feb 05, 2014 3:05:50 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource WARNING: JSF1064: Unable to find or serve resource, /preQcFormDean.view.xml.

Feb 05, 2014 3:05:50 PM com.sun.faces.context.ExternalContextImpl getMimeType WARNING: JSF1091: No mime type could be found for file /preQcFormDean.jsp. To resolve this, add a mime-type mapping to the applications web.xml.

and this is my web.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xmlns="http://java.sun.com/xml/ns/javaee"                                        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee                                                  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
         version="3.0">

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>

    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>

    <context-param>
        <description>State saving method: 'client' or 'server' (default). See JSF   Specification section 2.5.2</description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>

    <welcome-file-list>
        <welcome-file>index.jsf</welcome-file>
        <welcome-file>welcome.jsf</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

</web-app>

and here are the jar files in the lib folder

javax.faces.jar 
jsf-api.jar 
jstl-1.2.jar 
jsf-impl.jar
Was it helpful?

Solution 2

Get rid of jsf-api.jar and jsf-impl.jar. They are already represented by the single javax.faces.jar. Right now you're effectively having two different JSF APIs and impls in webapp's runtime classpath which would only lead to class conflicts in all colors.

Big chance that those are actually of legacy JSF 1.x version (you'd first extract the JAR file with a zip tool and then read the /META-INF/MANIFEST.MF file for the exact version detail) which used the ancient JSP as default view technology which in turn at least explains why all your views were by default interpreted as JSP.

OTHER TIPS

try to add the following lines in the web.xml

<mime-mapping>
    <extension>xhtml</extension>
    <mime-type>application/xml</mime-type>
</mime-mapping>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top