0 Replies Latest reply on Mar 13, 2006 12:17 AM by Mirko Adari

    Problem with getting Facelets work without Seam

    Mirko Adari Novice

      Everything seams to be fine, but when i point to main.jsf then it just says
      that no resource found. Shouldn`t it render main.xhtml and show it to me?
      Or am i getting smth wrong?
      Here are my conf files:
      web.xml:
      <?xml version='1.0' encoding='UTF-8'?>

      <!DOCTYPE web-app PUBLIC
      "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">


      <web-app>

      <display-name>Facelets</display-name>
      Something

      <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>


      <context-param>
      <param-name>facelets.REFRESH_PERIOD</param-name>
      <param-value>2</param-value>
      </context-param>

      <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>true</param-value>
      </context-param>

      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</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>com.sun.faces.validateXml</param-name>
      <param-value>true</param-value>

      Set this flag to true if you want the JavaServer Faces
      Reference Implementation to validate the XML in your
      faces-config.xml resources against the DTD. Default
      value is false.

      </context-param>

      <context-param>
      <param-name>com.sun.faces.verifyObjects</param-name>
      <param-value>true</param-value>

      Set this flag to true if you want the JavaServer Faces
      Reference Implementation to verify that all of the application
      objects you have configured (components, converters,
      renderers, and validators) can be successfully created.
      Default value is false.

      </context-param>

      <!-- Faces Servlet -->

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



      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>
      <security-constraint>
      <web-resource-collection>
      <web-resource-name>Secure area</web-resource-name>
      Security for Protected Pages
      <url-pattern>/haldus/*</url-pattern>
      <http-method>POST</http-method>
      <http-method>GET</http-method>
      </web-resource-collection>
      <auth-constraint>
      Only the Debugger can see this
      <role-name>Admin</role-name>
      </auth-constraint>
      </security-constraint>


      <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>DigizoneSecurity</realm-name>
      <form-login-config>
      <form-login-page>/haldus/login.jsp</form-login-page>
      <form-error-page>/haldus/loginError.jsp</form-error-page>
      </form-login-config>
      </login-config>


      <security-role>
      The role of a HelloWorld
      <role-name>Admin</role-name>
      </security-role>


      </web-app>

      faces-config.xml
      <?xml version='1.0' encoding='UTF-8'?>

      <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

      <faces-config>

      <!-- from project setup -->
      <!-- Facelets support -->

      <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>



      </faces-config>

      I have main.xhtml in docroot.

      Thanks