4 Replies Latest reply on Jun 10, 2008 11:21 AM by Fab Mars

    command button doesn't work

    Mario Ramos Newbie

      i have :

      welcomeJSF.jsp :

      ############################################
      <%@page contentType="text/html"%>
      <%@page pageEncoding="UTF-8"%>

      <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
      <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
      <%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
      <%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">

      <%--
      This file is an entry point for JavaServer Faces application.
      --%>

      <html.>
      <head.>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title.>JSP Page</title.>
      </head.>
      <body.>
      <f:view.>
      <a4j:form.>
      <a4j:commandButton id="login" value="Login" action="#{LoginBean.ingresoAplicacion}"/>
      </a4j:form.>
      </f:view.>
      </body.>
      </html.>
      ##########################################

      principal.jsp :

      ###########################################
      <%@page contentType="text/html" pageEncoding="UTF-8"%>
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">

      <html.>
      <head.>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8".>
      <title.>JSP Page</title.>
      </head.>
      <body.>
      <h2>Hello World!</h2>


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

      <!-- =========== FULL CONFIGURATION FILE ================================== -->

      <faces-config version="1.2"
      xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
      <managed-bean>
      <display-name>Login Bean</display-name>
      <managed-bean-name>LoginBean</managed-bean-name>
      <managed-bean-class>com.requerimientos.backbeans.LoginBean</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
      <navigation-rule>
      <from-view-id>/welcomeJSF.jsp</from-view-id>
      <navigation-case>
      <from-outcome>principal</from-outcome>
      <to-view-id>/principal.jsp</to-view-id>
      </navigation-case>
      </navigation-rule>
      </faces-config>
      ###########################################
      LoginBean.java
      ###########################################
      /*
      * To change this template, choose Tools | Templates
      * and open the template in the editor.
      */

      package com.requerimientos.backbeans;

      /**
      *
      * @author Mario_Ramos
      */
      public class LoginBean {

      public String ingresoAplicacion(){
      return "principal";
      }

      }

      ###########################################
      when i click the button on the welcomeJSF.jsp page, the next page it's never display.

      i've tryed for a few days and nothing happends.
      i'm using netbeans 6.1 and glassfish v2

      please help me!