Olá pessoal,
Estou tento um problema com struts que não estou conseguindo resolver, se alguém puder me dar uma ajuda..
Erro:
HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Invalid argument looking up property: "contato.nome" of bean: "org.apache.struts.taglib.html.BEAN" org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
Struts-config.xml
<form-beans>
<form-bean name="ContatoForm" type="br.com.caelum.form.ContatoForm"/>
</form-beans>
<action path="/novoContato" name="ContatoForm" type="br.com.caelum.struts.action.AdicionaContatoAction">
<forward name="ok" path="/listaContatos.do"/>
</action>
Acton
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
ContatoForm formulario = (ContatoForm) form;
Contato contato = formulario.getContato();
ContatoDAO dao = new ContatoDAO();
dao.adiciona(contato);
return mapping.findForward(SUCCESS);
}
Form
private Contato contato = new Contato();
public Contato getContato() {
return contato;
}
public void setContato(Contato contato) {
this.contato = contato;
}