1 Reply Latest reply on May 3, 2010 5:33 PM by Nick Belaevski

    Issues using XHTML instead of jspx

    Vinny Tiwari Newbie


      Hi,

        I am doing GUI development using JSF and Richfaces. I created the JSF files with extension .jspx and everything is working fine. But when I try to use XHTML I get some issues. After running the project I see a dialog getting opened prompting for Saving or Opening a file with the Project name. index.jsp is the welcome file which further uses JSP Forward to invoke xhtml file.

       

        I am wondering if my web.xml configurations are correct. Following is content of web.xml

       

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

      <!-- Plugging the "Blue Sky" skin into the project -->
      <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>blueSky</param-value>
      </context-param>

      <!-- Making the RichFaces skin spread to standard HTML controls -->
      <context-param>
        <param-name>org.richfaces.CONTROL_SKINNING</param-name>
        <param-value>enable</param-value>
      </context-param>

      <!--<context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.jspx</param-value>
      </context-param>-->


              <context-param>
                       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                       <param-value>.xhtml</param-value>
              </context-param>

              <context-param>
                       <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
                       <param-value>true</param-value>
              </context-param>

      <filter>
        <display-name>RichFaces Filter</display-name>
        <filter-name>richfaces</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>

      <filter-mapping>
        <filter-name>richfaces</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>

      <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
      </listener>

      <!-- Faces Servlet -->
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>

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

      <login-config>
        <auth-method>BASIC</auth-method>
      </login-config>

      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      </web-app>


      I have used the following doctype and xmlns in xhtml file.

      <?xml version='1.0' encoding='UTF-8' ?>
      <!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:ui="http://java.sun.com/jsf/facelets"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:h="http://java.sun.com/jsf/html"         xmlns:a4j="http://richfaces.org/a4j"
             xmlns:c="http://java.sun.com/jsp/jstl/core"
             xmlns:rich="http://richfaces.org/rich">


      Pl. help me get this resolve.

      Thanks