Fala aí pessoal, blz? Seguinte estou criando uma aplicação e estou usando JSF mas estou tendo um problema. Quando vou fazer o deploy de minh aplicação surge a seguinte exception:
org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.el.JspPropertyNotFoundException: /Login.jsp(15,16) '#{Login.usuario}' Target Unreachable, identifier 'Login' resolved to null
at org.apache.jasper.el.JspValueExpression.setValue(JspValueExpression.java:91)
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:213)
at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:211)
at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:476)
at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:660)
at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1111)
at com.sun.faces.taglib.html_basic.InputTextTag.doStartTag(InputTextTag.java:419)
at org.apache.jsp.Login_jsp._jspx_meth_h_005finputText_005f0(Login_jsp.java:241)
at org.apache.jsp.Login_jsp._jspx_meth_h_005fform_005f0(Login_jsp.java:162)
at org.apache.jsp.Login_jsp._jspx_meth_f_005fview_005f0(Login_jsp.java:120)
at org.apache.jsp.Login_jsp._jspService(Login_jsp.java:83)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:439)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:114)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
O Código de meu bean é esse:
[code]
public class Login {
private AuthenticationController authenticationController = null;
private String usuario;
private String senha;
/** Creates a new instance of Login1 */
public Login() {
authenticationController = (AuthenticationController) ServiceDelegate.getInstancia().obtemServico("authenticationController");
}
public String login() {
return authenticationController.autenticar(usuario, senha);
}
public String getUsuario() {
return usuario;
}
public void setUsuario(String usuario) {
this.usuario = usuario;
}
public String getSenha() {
return senha;
}
public void setSenha(String senha) {
this.senha = senha;
}
}[/code]
O meu JSP é:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<html>
<f:view>
<body>
<h:form>
<h:inputText value="#{Login.usuario}" id="txtUsuario" required="true" style="height: 20px; left: 20px; top: 165px; position: absolute; width: 260px"/>
<h:inputSecret value="#{Login.senha}" id="pwdSenha" required="true" style="height: 20px; left: 20px; top: 215px; position: absolute; width: 260px"/>
<h:commandButton action="#{Login.login}" id="btnLogin" style="height: 20px; left: 19px; top: 255px; position: absolute; width: 70px" value="Login"/>
<h:outputLabel id="staticText1" style="height: 20px; left: 20px; top: 140px; position: absolute; vertical-align: sub; width: 90px" value="Nome"/>
<h:outputLabel id="staticText2" style="height: 15px; left: 20px; top: 195px; position: absolute; vertical-align: sub; width: 100px" value="Senha"/>
<h:outputLabel id="staticText3" style="height: 20px; left: 260px; top: 105px; position: absolute; text-align: center; width: 260px" value="Projeto Exemplo - Arquitetura Escola"/>
<h:graphicImage height="75" id="imgTopo1" style="height: 80px; left: 20px; top: 15px; position: absolute; width: 151px" url="/resources/topo1.jpg" width="140"/>
<h:graphicImage height="80" id="imgTopo2" style="height: 80px; left: 170px; top: 15px; position: absolute; width: 151px" url="/resources/topo2.jpg" width="75"/>
<h:graphicImage height="80" id="imgTopo3" style="height: 80px; left: 320px; top: 15px; position: absolute; width: 151px" url="/resources/topo3.jpg" width="75"/>
<h:graphicImage height="30" id="imgTopo4" style="height: 80px; left: 471px; top: 15px; position: absolute; width: 151px" url="/resources/topo4.jpg" width="105"/>
<h:graphicImage height="25" id="imgTopo5" style="height: 80px; left: 621px; top: 15px; position: absolute; width: 151px" url="/resources/topo5.jpg" width="85"/>
</h:form>
</body>
</f:view>
</html>
Meu managed-beans.xml está assim:
<?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>
<!-- ... -->
<managed-bean>
<managed-bean-name>Login</managed-bean-name>
<managed-bean-class>exemploescola.Login</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<!-- ... -->
</faces-config>
E aí, alguém ajuda esse pobre mortal?