1 Reply Latest reply on Jul 21, 2006 2:33 PM by Carlton Samuels

    JSF and JBOSS

    paata lominadze Master

      i want run jsf application on jboss-4.0.4.GA
      but i get an error

      15:02:04,843 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      javax.servlet.jsp.JspException: Cannot find FacesContext
       at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:405)
       at org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
       at org.apache.jsp.pages.studreg_jsp._jspx_meth_f_view_0(studreg_jsp.java:85)
       at org.apache.jsp.pages.studreg_jsp._jspService(studreg_jsp.java:60)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      


      there is my project files :
      1.web.xml

      <?xml version="1.0"?>
      <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">
       <display-name>test1</display-name>
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>server</param-value>
       </context-param>
       <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>*.faces</url-pattern>
       </servlet-mapping>
       <login-config>
       <auth-method>BASIC</auth-method>
       </login-config>
      </web-app>
      



      2.faces-config.xml

      <?xml version="1.0"?>
      <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
       "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
      <faces-config>
       <managed-bean>
       <managed-bean-name>studentBean</managed-bean-name>
       <managed-bean-class>com.magti.common.ejb3Beans.StudentBean</managed-bean-class>
       <managed-bean-scope>request</managed-bean-scope>
       <managed-property>
       <property-name>age</property-name>
       <property-class>java.math.BigDecimal</property-class>
       <value/>
       </managed-property>
       <managed-property>
       <property-name>groupid</property-name>
       <property-class>java.math.BigDecimal</property-class>
       <value/>
       </managed-property>
       <managed-property>
       <property-name>id</property-name>
       <property-class>java.lang.Integer</property-class>
       <value/>
       </managed-property>
       <managed-property>
       <property-name>name</property-name>
       <property-class>java.lang.String</property-class>
       <value/>
       </managed-property>
       <managed-property>
       <property-name>surname</property-name>
       <property-class>java.lang.String</property-class>
       <value/>
       </managed-property>
       </managed-bean>
       <navigation-rule>
       <from-view-id>/index.jsp</from-view-id>
       <navigation-case>
       <from-outcome>studreg</from-outcome>
       <to-view-id>/pages/studreg.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      </faces-config>
      



      3.index.jsp

      <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
      <html>
      <head></head>
       <body>
       <jsp:forward page="/pages/studreg.faces" />
       </body>
      </html>
      


      4.studreg.jsp
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <html>
       <head>
       <title></title>
       </head>
       <body>
       <f:view>
       <p>asdfsdfsm,fnsm,dnfm,sdnfm,sdf</p>
       </f:view>
       </body>
      </html>
      
      



      please help me ............