You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Scrut Inizer <sc...@hotmail.com> on 2006/06/03 20:48:45 UTC

Simple page that works with MyFaces doesn't work with Sun RI

Hi

I wrote a very simple JSF page as shown below. It works as is with MyFaces. 
Now I tried to make it work with Sun RI as well.

Here's the problem: The page appears perfectly fine (it shows two columns of 
links). Only one single link works, though: the first one in the left 
column.
When I click on that first link, the action handler method ("userClick") is 
called and executed fine.

But when I click on any other link, the method is not called at all. All I 
get is an "error on page" message in the browser status bar. No log message 
on the command line or log file.
Am I doing something wrong? With MyFaces it works fine.

===============================
Here's the page:
===============================

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
<f:loadBundle 
basename="ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle" 
var="bundle" />

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><h:outputText value="#{bundle.menu_frame}" /></title>
<link rel="stylesheet" href="style.css">
</head>

<body>
<h:panelGrid border="1" columns="2" columnClasses="td">
<h:dataTable value="#{MenuBackingBean.menuTabItems}" border="0" 
var="menuTabItem" >
<h:column>
<h:form>
<h:commandLink action="#{MenuBackingBean.userClick}" >
<h:outputText value="#{menuTabItem.itemName}" />
<f:param name="itemID" value="#{menuTabItem.itemID}" />
</h:commandLink>
</h:form>
</h:column>
</h:dataTable>
<h:dataTable value="#{MenuBackingBean.menuItems}" border="0" var="menuItem" 
 >
<h:column>
<h:form>
<h:commandLink action="#{MenuBackingBean.userClick}" >
<h:outputText value="#{menuItem.itemName}" />
<f:param name="itemID" value="#{menuItem.itemID}" />
</h:commandLink>
</h:form>
</h:column>
</h:dataTable>
</h:panelGrid>
</body>
</html>
</f:view>


==================================
Here's the faces-config
==================================

<?xml version="1.0" encoding="UTF-8"?>
<!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 >
<application>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>de</supported-locale>
</locale-config>
<message-bundle>ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle</message-bundle>
</application>
<managed-bean>
<managed-bean-name>DetailsBackingBean</managed-bean-name>
<managed-bean-class>ca.gc.nrc.iit.eConservatoire.frontend.DetailsBackingBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>MenuBackingBean</managed-bean-name>
<managed-bean-class>ca.gc.nrc.iit.eConservatoire.frontend.MenuBackingBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>ContentBackingBean</managed-bean-name>
<managed-bean-class>ca.gc.nrc.iit.eConservatoire.frontend.ContentBackingBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/menu.jsp</from-view-id>
<navigation-case>
<from-outcome>showDetails</from-outcome>
<to-view-id>/details.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>menu</from-outcome>
<to-view-id>/menu.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/details.jsp</from-view-id>
<navigation-case>
<from-outcome>showMenu</from-outcome>
<to-view-id>/menu.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>showContent</from-outcome>
<to-view-id>/content.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/content.jsp</from-view-id>
<navigation-case>
<from-outcome>showMenu</from-outcome>
<to-view-id>/menu.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>

=======================================
web.xml
=======================================
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
  </context-param>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>
</web-app>
=======================================

I don't think I need to show the backing bean with the userClick() method 
since the error is that this method is not even called (I added a 
system.out.println() to this method - which is never executed)

So the problem must be before

BTW I am using Sun RI 1.1.01 as shipped with the MyEclipseIDE extensions.

Thanks a lot for your very much appreciated help

scrut