Olá
Tenho uma action e toda vez que for executada eu tenho que saber se será feita uma inclusao ou uma alteracao e por isso eu criei dois methodo incluir e altera, porem quando eu compilo essa essa action ele me apresenta a seguinte msg de erro:
Error(66,26): method does not return a value
Teria alguma forma de corrigir isso?
Grato
package br.com.teste;
import java.io.IOException;
import javax.servlet.ServletException;
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;
import org.apache.struts.action.Action;
public class TesteAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws IOException,
ServletException {
if( request.getParameter("acao").equals("incluir") ){
return this.Incluir(mapping, form, request,response );
}
if( request.getParameter("acao").equals("alterar") ){
return this.alterar(mapping, form, request,response );
}
}
//==============methodo incluir==================
public ActionForward Incluir(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws IOException,
ServletException {
return mapping.findForward("incluir");
}
//==============methodo alterar==================
public ActionForward alterar(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws IOException,
ServletException {
return mapping.findForward("alterar");
}
}