Olá!
Construí uma aplicação Myfaces no JDev e rodou neste último perfeitamente. Acontece que fui testar a mesma aplicação no Tomcat e recebi o seguinte erro:
javax.servlet.ServletException: Cannot get value for expression '#{index.texto}'
javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
O meu bean index.java é o seguinte:
import javax.faces.component.html.HtmlInputText;
public class index {
private HtmlInputText texto;
public index() {
}
public void setTexto(HtmlInputText texto) {
this.texto = texto;
}
public HtmlInputText getTexto() {
return texto;
}
}
e a minha página index.jsp é a seguinte:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/>
<title>index</title>
</head>
<body><h:form>
<p>
Teste
</p>
<p>
<h:inputText required="true" binding="#{index.texto}"/>
</p>
<p>
<h:commandButton value="ok" action="success"/>
</p>
</h:form></body>
</html>
</f:view>
Alguém teria idéia de como resolver este problema?
Obrigado!