[newbie]: click on commandButton does nothing. Why?
I am sure this is a super simple newbie problem, but would you mind helping me? Thanks so much! I wanted to start playing with MyFaces and JSF by building a tiny application: index.jsp simply forwards to menu.faces (which is the file menu.jsp) In menu.jsp there is one little button leading to details.jsp In details.jsp there are two buttons: one leading back to menu.jsp and one leading to content.jsp content.jsp has a button to menu.jsp. I can deploy everything in Tomcat 5.5 and call each page individually by using the .faces suffix instead of their real file name suffix .jsp. But here is the thing: when I click on any of those buttons, nothing happens. Absolutely nothing. I have added a System.outÂ… statement in the method that is supposed to be called but that is not called either. Do you have any idea what I did wrong? Here some code: - Index.jsp - - Menu.jsp - <%@ 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" %> menu // - Details.jsp - <%@ 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" %> - Content.jsp - <%@ 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" %> content - Faces-config.xml - http://java.sun.com/dtd/web-facesconfig_1_1.dtd";> en en de ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle DetailsBackingBean ca.gc.nrc.iit.eConservatoire.frontend.DetailsBackingBean session Title of the Learning Object title java.lang.String Author of the Learning Object author java.lang.String MenuBackingBean ca.gc.nrc.iit.eConservatoire.frontend.MenuBackingBean session ContentBackingBean ca.gc.nrc.iit.eConservatoire.frontend.ContentBackingBean session /menu.jsp showDetails /details.jsp menu /menu.jsp /details.jsp showMenu /menu.jsp showContent /content.jsp /content.jsp showMenu /menu.jsp - Web.xml - 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";> javax.faces.CONFIG_FILES /WEB-INF/faces-config.xml org.apache.myfaces.webapp.StartupServletContextListener Faces Servlet javax.faces.webapp.FacesServlet 0 Faces Servlet *.faces MyFacesExtensionsFilter org.apache.myfaces.component.html.util.ExtensionsFilter maxFileSize 20m
RE: [newbie]: click on commandButton does nothing. Why?
Enclose your buttons in an tag. -Original Message- From: Matthias Klein [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 10, 2006 3:11 PM To: users@myfaces.apache.org Subject: [newbie]: click on commandButton does nothing. Why? I am sure this is a super simple newbie problem, but would you mind helping me? Thanks so much! I wanted to start playing with MyFaces and JSF by building a tiny application: index.jsp simply forwards to menu.faces (which is the file menu.jsp) In menu.jsp there is one little button leading to details.jsp In details.jsp there are two buttons: one leading back to menu.jsp and one leading to content.jsp content.jsp has a button to menu.jsp. I can deploy everything in Tomcat 5.5 and call each page individually by using the .faces suffix instead of their real file name suffix .jsp. But here is the thing: when I click on any of those buttons, nothing happens. Absolutely nothing. I have added a System.out... statement in the method that is supposed to be called but that is not called either. Do you have any idea what I did wrong? Here some code: - Index.jsp - - Menu.jsp - <%@ 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" %> menu // - Details.jsp - <%@ 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" %> - Content.jsp - <%@ 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" %> content - Faces-config.xml - http://java.sun.com/dtd/web-facesconfig_1_1.dtd";> en en de ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBun dle DetailsBackingBean ca.gc.nrc.iit.eConservatoire.frontend.DetailsBacking Bean session Title of the Learning Object title java.lang.String Author of the Learning Object author java.lang.String MenuBackingBean ca.gc.nrc.iit.eConservatoire.frontend.MenuBackingBea n session ContentBackingBean ca.gc.nrc.iit.eConservatoire.frontend.ContentBacking Bean session /menu.jsp showDetails /details.jsp menu /menu.jsp /details.jsp showMenu /menu.jsp showContent /content.jsp /content.jsp showMenu /menu.jsp - Web.xml - http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="2.4" xsi
RE: [newbie]: click on commandButton does nothing. Why?
Thank you so much! Now it works. I _knew_ it was a stupid, little newbie mistake :-) Am Mi, 10.05.2006, 23:13, schrieb James Reynolds: > Enclose your buttons in an tag. > > > -Original Message- > From: Matthias Klein [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 10, 2006 3:11 PM > To: users@myfaces.apache.org > Subject: [newbie]: click on commandButton does nothing. Why? > > > I am sure this is a super simple newbie problem, but would you mind > helping me? Thanks so much! > > I wanted to start playing with MyFaces and JSF by building a tiny > application: > index.jsp simply forwards to menu.faces (which is the file menu.jsp) In > menu.jsp there is one little button leading to details.jsp In details.jsp > there are two buttons: one leading back to menu.jsp and one leading to > content.jsp content.jsp has a button to menu.jsp. > > I can deploy everything in Tomcat 5.5 and call each page individually by > using the .faces suffix instead of their real file name suffix .jsp. > > But here is the thing: when I click on any of those buttons, nothing > happens. Absolutely nothing. I have added a System.out... statement in the > method that is supposed to be called but that is not called either. > > Do you have any idea what I did wrong? > > > Here some code: > > > - > Index.jsp > - > > > > > > > > - > Menu.jsp > - > <%@ 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" %> > basename="ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle" > var="bundle" /> > > > > > value="#{bundle.menu_frame}" /> > > > > > > menu //action="#{MenuBackingBean.userClick}" /> rendered="true" action="showDetails" /> > > > > > - > Details.jsp > - > <%@ 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" %> > basename="ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle" > var="bundle" /> > > > > > value="#{bundle.details_frame}" /> > > > > > > > value="#{bundle.details_title}" /> value="#{DetailsBackingBean.title}" /> value="#{bundle.details_author}" /> value="#{DetailsBackingBean.author}" /> > > > value="#{bundle.details_startbutton}." rendered="true" > action="#{DetailsBackingBean.showContent}" /> value="#{bundle.details_backbutton}" rendered="true" > action="#{DetailsBackingBean.showMenu}" /> > > > > > > > - > Content.jsp > - > <%@ 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" %> > basename="ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle" > var="bundle" /> > > > > > value="#{bundle.content_frame}" /> > > > > > > content value="#{bundle.content_backbutton}" rendered="true" > action="#{ContentBackingBean.showMenu}" /> > > > > > > > - > Faces-config.xml > - > > Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd";> > > > > > > > > en > en > de > > > > ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBun > dle > > > > > > DetailsBackingBean > > > ca.gc.nrc.iit.eConservatoire.frontend.DetailsBacking > Bean > session > > Title of the Learning > Object > title > > > java.lang.String > > > > Author of the Learning > Object > author > > > java.lang.String > > > > > > > MenuBackingBean > > > ca.gc.nrc.iit.eConservatoire.frontend.MenuBackingBea > n session > > > > > ContentBackingBean > > > ca.gc.nrc.iit.eConservatoire.frontend.ContentBacking > Bean > session > > > > > /menu.jsp > > showDetails > /details.jsp > > > menu > /menu.jsp > > > > /details.jsp > > showMenu > /menu.jsp > > > showContent > /content.jsp > > > > /content.jsp > > showMenu > /menu.jsp > > > > > > > - > Web.xml > - > > 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";> > > javax.faces.CONFIG_FILES > /WEB-INF/faces-config.xml > > > > > org.apache.myfaces.webapp.StartupServletContextListener< > /listener-class> > > > Faces Servlet > javax.faces.webapp.FacesServlet > 0 > > > Faces Servlet > *.faces > > > MyFacesExtensionsFilter > > > org.apache.myfaces.component.html.util.ExtensionsFilter ilter-class> > maxFileSize > 20m > > > > MyFacesExtensionsFilter > *.faces > > > > > > > >