Hi...
I will try to explain my problem.....
I have this action mapping
<action path="/Interface/Acompanhamento/Html/Projeto"
type="com.procergs.spo.actions.ProjetoAction"
name="projetoForm"
scope="request"
parameter="acao"
validate="false">
<forward name="pesquisa"
path="/Interface/Acompanhamento/jsp/Projeto-Pesquisa.jsp" redirect="false"
contextRelative="true" />
<forward name="lista"
path="/Interface/Acompanhamento/jsp/Projeto-Lista.jsp" redirect="false"
contextRelative="true"/>
<forward name="inclui"
path="/Interface/Acompanhamento/jsp/Projeto-Lista.jsp" redirect="false"
contextRelative="true" />
<forward name="novo" path="/Interface/Acompanhamento/jsp/Projeto-Novo.jsp"
redirect="false" contextRelative="true" />
</action>
As all of you can see, i am using the "parameter" attribute so i can pass which method
to call. There�s no "input" because depending on what method to call, i have different
inputs, different forwards.
Well, when in an action class i catch an error i want that the user see the same page
he/she was submiting. The code im my action is.
.....
public ActionForward inclui(ActionMapping mapping,
ActionForm form,
HttpServletRequest req,
HttpServletResponse res) throws Exception {
try {
ProjetoVO projetovo = new ProjetoVO();
CopyBean.getInstance().copyProperties(projetoVO,form);
ProjetoDelegate.getInstance().inclui(projetoED);
}
catch (Exception ex) {
ActionErrors mensagens = new ActionErrors();
ActionError actionError = new ActionError("projeto.siglaProjeto");
mensagens.add("projeto.siglaProjeto",actionError);
this.saveMessages(req,mensagens);
return mapping.findForward("novo");
}
return mapping.findForward("novo");
}
.....
In the catch block i create an error, save this error and would like to return control
to the struts framework so it can show the same page again with the same data the user
submited.
But nothing happens, the page is not shown again and no error occurs.
This line
return mapping.findForward("novo");
i supposed this line would tell struts to reload the same page again because "novo" is
a forward to the page the user was submiting.
As i saw in the "Programming Jakarta Struts" book i could make this way
return mapping.findForward( mapping.getInput( ) );
but i have no "input" attribut set and can not set none.
What am doing wrong? Any idea?
Thanks in advance
Giovani Salvador
PROCERGS