Bom dia pessoal,
Estou tentando meu primeiro aplicativo JSF, porém aparece o seguinte problema.
Alguem teria alguma solução?
Obrigado
root cause
javax.servlet.jsp.JspException: No faces context?!
org.apache.myfaces.taglib.core.LoadBundleTag.doStartTag(LoadBundleTag.java:74)
org.apache.jsp.login_jsp._jspx_meth_f_loadBundle_0(login_jsp.java:109)
org.apache.jsp.login_jsp._jspService(login_jsp.java:72)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter
loginbean.java
/**
*
*/
package sample;
/**
* @author danielcastro
*
*/
public class loginbean {
private java.lang.String email;
private java.lang.String password;
public loginbean() {
}
public java.lang.String getEmail() {
return email;
}
public void setEmail(java.lang.String email) {
this.email = email;
}
public java.lang.String getPassword() {
return password;
}
public void setPassword(java.lang.String password) {
this.password = password;
}
}
login.jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:loadBundle basename="sample.messages" var="messages"/>
<html>
<head>
<title></title>
</head>
<body>
<f:view>
<h:form>
<h:panelGrid columns="2" border="1" width="243">
<h:outputText value="#{messages.emailLabel}"/>
<h:inputText value="#{loginbean.email}" style="height : 26px; width : 132px;" />
</h:panelGrid>
<h:panelGrid columns="2" border="1" width="243">
<h:outputText value="#{messages.passwordLabel}"/>
<h:inputText value="#{loginbean.password}" style="height : 26px; width : 132px;" />
</h:panelGrid><h:commandButton action="welcome" value="#{messages.buttonLabel}"/>
</h:form></f:view>
</body>
</html>
welcome.jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:loadBundle basename="sample.messages" var="msg" />
<html>
<head>
<title></title>
</head>
<body>
<f:view>
<h:outputText value="#{msg.welcomeMessage}"/>
<h:outputText value="#{loginbean.email}"/>
</f:view>
</body>
</html>
Obrigado