p:resources problema con JSF
buenas, acabo de agregar a mi proyecto JSF 1.2 la librería primefaces 1.1 .También agregué el template trontastic y he hecho como prueba un login el cual tiene un usuario y password y llama a un metodo en el bean el cual devuelve un String "logueado" para redireccionar a la página de inicio.jspx dicha navegacion se maneja desde el faces config.
El problema es el siguiente.
cuando agrego el tag <p:resources />
la página se muestra correctamnete pero al accionar el boton no pasa nada.
De lo contrario si borro el tag <p:resources />
, la página se comporta normalmente, al apretar el botón me redirecciona al inicio.jspx, pero la presentación de la página es diferente en cuanto al skin,
o sea. Se carga correctamente todo con el tag <p:resources>
pero el boton no hace nada.
les muestro el código:
login.jspx
<!--
Document : login
Created on : 12-ene-2011, 10:57:45
Author : castiglioni
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
version="2.1">
<jsp:directive.page contentType="text/html" pageEncoding="UTF-8"/>
<c:url var="cssUrl" value="/css/trontastic/skin.css"/>
<f:view>
<html>
<head>
<p:resources />
<link rel="stylesheet" href="${cssUrl}" type="text/css"/>
</head>
<body>
<h:form styleClass="ui-widget">
<p:panel styleClass="ui-widget-content" header="Ingrese usuario y password">
<h:panelGrid styleClass="ui-widget-content" columns="2">
<h:outputText styleClass="textarea" value="nombre usuario"/>
<h:inputText value="#{beanLogin.usu.nombreUsuario}"/>
<h:outputText value="Password: " />
<p:password weakLabel="pobre" goodLabel="bueno" value="#{beanLogin.usu.password}" minLength="5" />
<p:commandButton value="entrar" action="#{beanLogin.login}"/>
</h:panelGrid>
</p:panel>
</h:form>
</body>
</html>
</f:view>
</jsp:root>
//------------------------------------------------------------------------------
beanLogin.jspx
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entCompartidas.DTUsuario;
import logica.Factory;
/**
*
* @author castiglioni
*/
public class beanLogin {
DTUsuario usu=new DTUsuario();
Factory f = new Factory();
public DTUsuario getUsu() {
return usu;
}
public void setUsu(DTUsuario usu) {
this.usu = usu;
}
public String login(){
// return f.getUsu().login(usu); se harcodea para ver si funciona
return "logueado";
//----------------------------------------------------------------------------------------------------------------
//FacesConfig.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">
<!--*********************NAVEGACION*************************-->
<navigation-rule>
<description>
</description>
<navigation-case>
<from-outcome>empleados</from-outcome>
<to-view-id>/empleados.jspx</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>escribanos</from-outcome>
<to-view-id>/escribanos.jspx</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>listarEmpleados</from-outcome>
<to-view-id>/listarEmpleados.jspx</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>listarClientes</from-outcome>
<to-view-id>/listarClientes.jspx</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>logueado</from-outcome>
<to-view-id>/inicio.jspx</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>
</description>
<navigation-case>
<from-outcome>inicio</from-outcome>
<to-view-id>/inicio.jspx</to-view-id>
</navigation-case>
</navigation-rule>
<!--*********************exito *************************-->
<navigation-rule>
<description>
</description>
<navigation-case>
<from-outcome>ok</from-outcome>
<to-view-id>/ok.jspx</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>
</description>
<navigation-case>
<from-outcome>empModificado</from-outcome>
<to-view-id>/ok.jspx</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>
</description>
<navigation-case>
<from-outcome>cliModificado</from-outcome>
<to-view-id>/ok.jspx</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>
</description>
<navigation-case>
<from-outcome>empEliminado</from-outcome>
<to-view-id>/ok.jspx</to-view-id>
</navigation-case>
</navigation-rule>
<!--*********************ERRORES *************************-->
<navigation-rule>
<description>
</description>
<navigation-case>
<from-outcome>error</from-outcome>
<to-view-id>/error.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>
</description>
<navigation-case>
<from-outcome>errorModificarEmpleado</from-outcome>
<to-view-id>/error.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>
</description>
<navigation-case>
<from-outcome>errorEliminarEmpleado</from-outcome>
<to-view-id>/error.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>
</description>
<navigation-case>
<from-outcome>errorModificarCliente</from-outcome>
<to-view-id>/error.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<!--*********************MANAGED BEANS*************************-->
<managed-bean>
<managed-bean-name>beanEmpleados</managed-bean-name>
<managed-bean-class>beans.beanEmpleados</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>beanEscribanos</managed-bean-name>
<managed-bean-class>beans.beanEscribanos</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>beanClientes</managed-bean-name>
<managed-bean-class>beans.beanClientes</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>beanLogin</managed-bean-name>
<managed-bean-class>beans.beanLogin</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
////----------------------------------------------------------------------------------------------------------------
A quien pueda ayudarme... mil gracias estoy re trancado con esto
les muestro como se ven mis páginas en ambos casos.
Adjunto | Tamaño |
---|---|
Login - imagen.jpg | 133.46 KB |
- Inicie sesión o regístrese para enviar comentarios
Comentarios recientes
hace 1 semana 1 día
hace 7 semanas 6 días
hace 1 año 4 días
hace 2 años 12 semanas
hace 2 años 16 semanas
hace 2 años 23 semanas
hace 2 años 31 semanas
hace 2 años 34 semanas
hace 2 años 36 semanas
hace 2 años 39 semanas