Question

My jsf page on IE won't show anything on firefox i atleast get the text. Strange thing is that there is no error so i am not sure what is wrong. I looked around for information and even added a f:view for the page but still nothing. Thank you for your time.

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml"
                  xmlns:h="http://xmlns.jcp.org/jsf/html"
                  xmlns:f="http://java.sun.com/jsf/core" 
                  xmlns:a4j="http://richfaces.org/a4j" >
            <f:view contentType="text/html">

            <h:head>
            <title>QC-Form</title>
            <link href="./css/styles.css" 
                  rel="stylesheet" type="text/css"/>
            </h:head>



            <h:body>
            <h1 class="title">QC Form</h1>
            <br/> <br/>

              <font face="comic sans MS" size="2" color="#33CCFF">
              <p><b>Enter the information below: </b> </p>
              </font>

            <h:form>

             <font face="comic sans MS" size="2"> 

             <h:panelGroup id="initialInfo">

                <b>Your initials: </b>  
                    <h:inputText value="#{qcFormBean.techNameValue}"/><br/>
                <br/>

                <b>Model #: </b>  
                <h:selectOneMenu value="#{qcFormBean.modelValue}">
                  <f:selectItem itemValue="3600" itemLabel="3600" />
                  <f:selectItem itemValue="7200" itemLabel="7200" />
                  <f:selectItem itemValue="8300" itemLabel="8300" />
                  <f:selectItem itemValue="8400" itemLabel="8400" />
                  <f:selectItem itemValue="8500p" itemLabel="8500p" />
                  <f:selectItem itemValue="8800" itemLabel="8800" />
                  <f:selectItem itemValue="9000" itemLabel="9000" />
                  <f:selectItem itemValue="9008" itemLabel="9008" />
                  <f:selectItem itemValue="9200" itemLabel="9200" />
                  <f:selectItem itemValue="9300" itemLabel="9300" />
                </h:selectOneMenu><br/>
                 <br/>

                <b>Date : </b>
                 <h:outputText  value="#{currentDate}"/>
                <br/> <br/>


                <b>Serial #: </b>  
                    <h:inputText value="#{qcFormBean.serialValue}"/><br/>
                <br/>

                <b>Customer Name: </b>  
                    <h:inputText value="#{qcFormBean.customerNameValue}"/><br/>
                <br/>

                <b>Special Instructions: </b>  
                    <h:inputText value="#{qcFormBean.specialInstructionsValue}"/><br/>    

             </h:panelGroup>
            </font>

              <font face="comic sans MS" size="2" color="#33CCFF">
              <p><b>QC Process</b> </p>
              </font>

             <font face="comic sans MS" size="2"> 

            <h:panelGroup id="dliSerial">
             <b>1.Unit Serial number has been applied: </b>
             <h:selectOneMenu value="#{qcFormBean.unitSerialValue}">
            <f:selectItems value="#{qcFormBean.valueQcValue}"/>
            </h:selectOneMenu>
            <br/>

            </h:panelGroup>

            <br/>
            <b>2.Screen Protector has been applied: </b>
            <h:panelGroup id="dliSticker">
                <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" />
                  <a4j:ajax event="change" execute="@this" render="perfbyDliSticker"  limitRender="true" />
                </h:selectOneMenu>
            </h:panelGroup>

            <h:panelGroup id="perfbyDlitcSticker">
                <h:selectOneMenu value="#{qcFormBean.stickerFreq}"
                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>


            <br/>
            </font>

            <h:commandButton action="#{qcFormBean.submitForm()}"/>

            </h:form>

            </h:body>

            </f:view>

            </html>

Update: Right clicking on the source file on firefox does show the raw code being displayed like this:

<b>Your initials: </b>  
    <h:inputText value=""></h:inputText><br />
<br />

<b>Model #: </b>  
<h:selectOneMenu value="">
</h:selectOneMenu><br />
 <br />

and my web.xml file has the following servlet information.

<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>*.jsf</url-pattern> 
</servlet-mapping> 
Was it helpful?

Solution

As per the symptoms described in the comments, the <f:xxx> and <a4j:xxx> tags are properly processed by JSF, but the <h:xxx> tags not. Now, let's look at their XML namespace declarations, which is where all the processing starts:

xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" 
xmlns:a4j="http://richfaces.org/a4j" >

The xmlns.jcp.org domain as you've declared for the <h:xxx> XML namespace is introduced since JSF 2.2. The symptom of it being unprocessed thus indicates that you aren't running JSF 2.2 at all, but an older JSF 2.x version, such as 2.0 or 2.1, which don't recognize the new XML namespace domains yet.

You've basically 2 options:

  1. Either fix the <h:xxx> XML namespace accordingly to match JSF 2.0/2.1 specification:

    xmlns:h="http://java.sun.com/jsf/html"
    
  2. Or, just upgrade to JSF 2.2.

OTHER TIPS

That means your jsf tags are not parsed to plain html. To confirm this one see the page view source if you could see the plain jsf tags then that is the problem.

The primary reason for tags not being parsed means your request is not being handed by Faces servlet. You should have some thing like this in your web.xml

 <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>*.xhtml</url-pattern>    
 </servlet-mapping>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top