facebook

JSF Display problem

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #271340 Reply

    Lasana
    Participant

    Hello,

    I have a problem with the display from a .jsf file. I am using Tomcat 5.5.23, jdk5 and when I deploy I get the following warnings:

    ContextListener: attributeAdded(‘com.sun.faces.ApplicationAssociate’, ‘com.sun.f
    aces.application.ApplicationAssociate@969c29’)
    ContextListener: attributeAdded(‘com.sun.faces.ConfigBase’, ‘true’)
    Jun 9, 2007 7:42:34 PM com.sun.faces.config.rules.ManagedBeanRule end
    WARNING: [ManagedBeanRule]{faces-config/managed-bean} Merge(UserBean)
    Jun 9, 2007 7:42:34 PM com.sun.faces.config.rules.NavigationRuleRule end
    WARNING: [NavigationRuleRule]{faces-config/navigation-rule} Merge(/index.jsf)
    Jun 9, 2007 7:42:34 PM com.sun.faces.config.rules.NavigationRuleRule end
    WARNING: [NavigationRuleRule]{faces-config/navigation-rule} Merge(/successSubmit
    .jsf)
    ContextListener: attributeAdded(‘com.sun.faces.ApplicationAssociate’, ‘com.sun.f
    aces.application.ApplicationAssociate@df0438’)
    ContextListener: attributeAdded(‘com.sun.faces.ConfigBase’, ‘true’)
    Jun 9, 2007 7:42:38 PM org.apache.coyote.http11.Http11BaseProtocol start

    So when I go to the URL, I get the .jsf source file. I don’t see it as a web page. This is really funny to me and I can’t figure it out.

    Here is the faces-config.xml file:

    <?xml version=’1.0′ encoding=’UTF-8′?>

    <faces-config xmlns=”http://java.sun.com/xml/ns/javaee&#8221;
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd&#8221;
    version=”1.2″>

    <managed-bean>
    <managed-bean-name>UserBean</managed-bean-name>
    <managed-bean-class>com.kt.jf.UserBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>user_name</property-name>
    <property-class>java.lang.String</property-class>
    <value></value>
    </managed-property>
    <managed-property>
    <property-name>message</property-name>
    <property-class>java.lang.String</property-class>
    <value></value>
    </managed-property>
    </managed-bean>
    <!– <application>
    <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
    </application> –>
    <navigation-rule>
    <from-view-id>/index.jsf</from-view-id>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/successSubmit.jsf</to-view-id>
    <redirect></redirect>
    </navigation-case>
    <navigation-case>
    <from-outcome>failure</from-outcome>
    <to-view-id>/index.jsf</to-view-id>
    <redirect></redirect>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/successSubmit.jsf</from-view-id>
    </navigation-rule>
    </faces-config>

    Here is the web.xml file:

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <web-app xmlns=”http://java.sun.com/xml/ns/javaee&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; version=”2.5″ xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”&gt;
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</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>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
    <param-value>true</param-value>
    </context-param>
    <servlet>
    <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>*.faces</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>index.jsf</welcome-file>
    </welcome-file-list>
    <!–Tomcat 5 Workaround: Listener used to initialize JSF on startup–>
    <!– <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    –>
    <!–Tomcat 5 Workaround: Listener implementation to handle web application lifecycle event–>
    <!–
    <listener>
    <listener-class>com.sun.faces.application.WebappLifecycleListener</listener-class>
    </listener>
    –>
    </web-app>

    Please any and all help will be greatly appreciated.

    #271341 Reply

    Lasana
    Participant

    Thank you.

    #271425 Reply

    Riyad Kalla
    Member

    Iasanac,
    There are a few things here.

    1) You are using a JEE 5 web.xml descriptor, and Tomcat 5.5 doesn’t support JEE 5 deployment descriptors, you need to use the Web 2.4 (J2EE 1.4) spec level for your file (you can create a new project and be sure to select J2EE 1.4) or upgrade to Tomcat 6 and keep your current project.

    2) Are you actually naming your physical pages with .jsf extensions? If you are, then Tomcat doesn’t know how to service them, so it’s just outputting the content it finds. Normally JSF pages are actually just .jsp files and you use the “url-pattern” in your web.xml file to direct people from URLs (home.faces) to your actual page (home.jsp)

    #271437 Reply

    Lasana
    Participant

    I will try that out. Thank you for your help, this was driving me crazy….

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: JSF Display problem

You must be logged in to post in the forum log in