dae pessoal,
estou com um erro na minha aplicação de teste…
org.apache.jasper.JasperException: Exception in JSP: /pages/welcome.jsp:12
9: </head>
10: <body>
11: <h3>MCTI - Login</h3>
12: <html:form action="Login" method="POST">
13: <table>
14: <tr>
15: <td>Usuário</td>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:506)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
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:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: Cannot retrieve definition for form bean loginAction on action Login
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:843)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:776)
org.apache.jsp.pages.welcome_jsp._jspService(welcome_jsp.java:83)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
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:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.jsp.JspException: Cannot retrieve definition for form bean loginAction on action Login
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:767)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
org.apache.jsp.pages.welcome_jsp._jspx_meth_html_form_0(welcome_jsp.java:135)
org.apache.jsp.pages.welcome_jsp._jspx_meth_html_html_0(welcome_jsp.java:108)
org.apache.jsp.pages.welcome_jsp._jspService(welcome_jsp.java:74)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
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:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
este dae é o erro…
vou colocar as listagens abaixo:
struts-config.xml:
[code]<?xml version="1.0" encoding="ISO-8859-1" ?>
<action
path="/Principal"
forward="/pages/principal.jsp" >
</action>
<action
path="/Login"
type="LoginAction"
name="loginAction"
scope="request"
input="/welcome.jsp">
<forward name="sucesso" path="/Principal" redirect="true" />
</action>
[/code]
welcome.jsp:
[code]<%@ taglib uri="/WEB-INF/struts-html" prefix=“html” %>
<%@ taglib uri="/WEB-INF/struts-bean" prefix=“bean” %>
<%@ taglib uri="/WEB-INF/struts-logic" prefix=“logic” %>
<%@ taglib uri="/WEB-INF/struts-nested" prefix=“nested” %>
MCTI - Login
Usuário | |
Senha | |
o Action do login:
[code]import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class LoginAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
LoginForm login = (LoginForm )form;
String username = login.getUsername();
String passwd = login.getPasswd();
/*if ("admin".equalsIgnoreCase(username) &&
"admin".equalsIgnoreCase(passwd) ) {
} */
return mapping.findForward("sucesso");
}
}[/code]
e o actionForm do login:
[code]import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
public class LoginForm extends ActionForm {
private String username;
private String passwd;
// gets and sets
public String getPasswd() {
return passwd;
}
public void setPasswd(String passwd) {
this.passwd = passwd;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public void reset(ActionMapping mapping, HttpServletRequest req) {
this.passwd = null;
this.username = null;
}
public ActionErrors validate (ActionMapping mapping, HttpServletRequest req) {
ActionErrors errors = new ActionErrors();
if (username == null || passwd == null) {
errors.add("errUsuarioSenha", new ActionError("UsuarioSenha.required"));
}
return errors;
}
}
[/code]
alguém ae pode me dar uma luz?!?!
qq ajuda será muitooo bem vinda!!!
[]s