CarneiroPJ 1 de mai. de 2007
VallePJ 2 de mai. de 2007
Obrigado !! nâo tenho que informar mais o <form-beans> </form-beans> ?
E minha Classe Actino nâo fica mais assim :
[i][b]
package ;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm ;
import org.apache.struts.action.ActionForward ;
import org.apache.struts.action.ActionMapping ;
public class ClienteAcao extends LeticiaAction {
public ActionForward inicio ( ActionMapping mapping , ActionForm form , HttpServletRequest request , HttpServletResponse response ) throws Exception {
// request .getSession () .getAttribute ( "loginForm" ) ;
return mapping .findForward ( "inicio" ) ;
}
public ActionForward Grava(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
// request . getSession () . getAttribute ( "loginForm" );
return mapping . findForward ( "gravar" );
}
}[/i][/b]
como fica ???
Obtigado !![/b]
fabiozoroastroPJ 2 de mai. de 2007
Agora sua configuração é assim:
struts.xml
& lt ; package name = "pub" extends = "struts-default" namespace = "/pub" & gt ;
& lt ; action name = "hello" class = "com.tst.MinhaAction" & gt ;
& lt ; result name = "input" & gt ; / jsp / entrada & lt ; / result & gt ;
& lt ; result name = "success" & gt ; / jsp / sucesso . jsp & lt ; / result & gt ;
& lt ; result name = "error" & gt ; / jsp / erro . jsp & lt ; / result & gt ;
& lt ; / action & gt ;
& lt ; / package & gt ;
& lt ; / struts & gt ;
E sua action:
public class MinhaAction extends ActionSupport & #123;
// Sobreescreva o método execute & #58;
@ Override
public String execute & #40;) throws Exception {
boolean submit , ok ;
if & #40;submit && ok)
return SUCCESS ;
else
return ERROR ;
return INPUT ;
& #125;
& #125;
Entendeu?
No link q o Carneiro passou tem tudo explicado.
VallePJ 2 de mai. de 2007
ok !!! obrigado vou olhar com mais detalhe !!!