Nao consigo acessar jsp

0 respostas
D

erro:

struts-config.xml

<!-- Cadastro de David -->
    <action path="/cadDavid" scope="request" name="davidForm" type="gpbr.web.blankproject.view.action.cadastros.caddavid.DavidAction" parameter="metodo">
      <forward name="showCadDavid" path="showCadDavid" />
      <forward name="insCadDavid" path="insCadDavid" />
      <forward name="detailCadDavid" path="detailCadDavid" />
      <forward name="deleteCadDavid" path="deleteCadDavid" />
    </action>
    <!-- Fim Cadastro david -->

tiles-defs.xml

<!-- Início Cadastro David -->
	<definition name="showCadDavid" extends="mainLayout">
    <put name="action" value="/cadDavid" />
    <put name="titleViewParent" value="Cadastros" />
    <put name="titleViewMain" value="Teste" />
	<put name="body" value="/views/david/cadDavid_show.jsp" />
	</definition>
  	<definition name="insCadDavid" extends="mainLayout">
    <put name="action" value="/cadDavid" />
    <put name="titleViewParent" value="Cadastros" />
    <put name="titleViewMain" value="Teste" />
    <put name="body" value="/views/david/cadDavid_ins.jsp" />
  	</definition>
  	<definition name="detailCadDavid" extends="mainLayout">
    <put name="action" value="/cadDavid" />
    <!-- put name="ONLOAD" value="javascript:exibirMensagem();" /-->
    <!-- <put name="titulo" value="/cadastros/alcada/includes/i_titulo.jsp" /> -->
    <put name="titleViewParent" value="Cadastros" />
    <put name="titleViewMain" value="Teste" />
    <put name="body" value="/views/david/cadDavid_detail.jsp" />
  	</definition>
  	<!-- Fim Cadastro David -->

DavidAction.jaca

public class DavidAction extends CadAction {
	
    protected BusinessDelegate getBusinessDelegate() {
        return new DavidBusinessDelegate();
    }

    public ActionForward showInsert(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
        return mapping.findForward("insCadDavid");
    }

    public ActionForward showDetail(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws GpbrPersistException, WebActionException {
        try {
            DavidVO DavidVO = (DavidVO) getBusinessDelegate().findById(((FormBean)form).getPersistentObj());
            if(DavidVO == null) {
            	request.setAttribute(this.MESSAGE_ATTRIBUTE, "Favor preencher o código do fabricante.");
            	return mapping.findForward("showCadDavid");
            }            
            request.setAttribute("DavidVO", DavidVO);
        } catch (GpbrPersistException e) {
            throw new GpbrPersistException("Erro ao fazer consulta de David.", e);
        }
        return mapping.findForward("detailCadDavid");
    }

    protected void persistedObject(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, Serializable serializable) {
    	DavidVO DavidVO = (DavidVO) ((List) serializable).get(0);
        request.setAttribute("detailInsVO", DavidVO);
    }
    
    public ActionForward showAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {       
        return mapping.findForward("showCadDavid");
    }
    
    public ActionForward insShowCadDavid(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {       
        return mapping.findForward("insShowCadDavid");
    }

    public String forwardTo(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, String commandType) {
    	if(CommandTypeConstants.INSERIR.equals(commandType)) {
    		return "insShowCadDavid";
    	}
        return "showAction";
    }
    
}
Criado 20 de outubro de 2006
Respostas 0
Participantes 1