src/it/finsiel/siged/mvc/presentation/action/amministrazione/firmadigitale/CertificateAuthorityAction.java
public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {

        ActionMessages errors = new ActionMessages();
        CertificateAuthorityForm caForm = (CertificateAuthorityForm) form;

        if (form == null) {
            caForm = new CertificateAuthorityForm();
            request.setAttribute(mapping.getAttribute(), caForm);
        }
        errors = caForm.validate(mapping, request);
        if (errors.isEmpty()) {
            if (request.getParameter("caSelezionata") != null) {
                // visualizza Ca
                try {
                    CaVO ca = FirmaDigitaleDelegate.getInstance().getCaById(
                            NumberUtil.getInt(request
                                    .getParameter("caSelezionata")));
                    if (ReturnValues.FOUND == ca.getReturnValue()) {
                        caricaForm(caForm, ca);
                    } else {
                        errors.add("generale", new ActionMessage(
                                "firmadigitale.errore.ca_non_trovata"));
                    }
                } catch (DataException e) {
                    errors.add("generale", new ActionMessage(
                            "database.cannot.load"));
                }
            } else if (request.getParameter("importa") != null) {
                uploadCertificate(caForm, errors);
            } else if (request.getParameter("nuovo") != null) {
                caricaForm(caForm, new CaVO());
            } else if (request.getParameter("rimuoviCRL") != null) {
                rimuoviSelezionati(caForm);
            } else if (request.getParameter("aggiungiCRL") != null) {
                aggiungiCRL(caForm);
            } else if (request.getParameter("salva") != null) {
                try {
                    CaVO ca = new CaVO();
                    caricaModel(caForm, ca);
                    FirmaDigitaleDelegate.getInstance()
                            .salvaCertificateAuthority(ca);
                    ActionMessages msg = new ActionMessages();
                    msg.add("salvato", new ActionMessage(
                            "firmadigitale.ca.salvata"));
                    saveMessages(request, msg);
                } catch (DataException e) {
                    errors.add("generale", new ActionMessage(
                            "database.cannot.save"));
                }
            }
        }
        saveErrors(request, errors);
        return (mapping.findForward("input"));
    }
/**
     * Process the specified HTTP request, and create the corresponding HTTP
     * response (or forward to another web component that will create it).
     * Return an <code>ActionForward</code> instance describing where and how
     * control should be forwarded, or <code>null</code> if the response has
     * already been completed.
     * 
     * @param mapping
     *            The ActionMapping used to select this instance
     * @param form
     *            The optional ActionForm bean for this request (if any)
     * @param request
     *            The HTTP request we are processing
     * @param response
     *            The HTTP response we are creating
     * 
     * @exception Exception
     *                if business logic throws an exception
     */
Process the specified HTTP request, and create the corresponding HTTP
response (or forward to another web component that will create it).
Return an ActionForward instance describing where and how
control should be forwarded, or null if the response has
already been completed.

@param mapping
The ActionMapping used to select this instance
@param form
The optional ActionForm bean for this request (if any)
@param request
The HTTP request we are processing
@param response
The HTTP response we are creating

@exception Exception
if business logic throws an exception
Process the specified HTTP request and create the corresponding HTTP response ( or forward to another web component that will create it ) . Return an ActionForward instance describing where and how control should be forwarded or null if the response has already been completed . @param mapping The ActionMapping used to select this instance @param form The optional ActionForm bean for this request ( if any ) @param request The HTTP request we are processing @param response The HTTP response we are creating @exception Exception if business logic throws an exception
public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        ActionMessages errors = new ActionMessages();
        CertificateAuthorityForm caForm = (CertificateAuthorityForm) form;
        if (form == null) {
            caForm = new CertificateAuthorityForm();
            request.setAttribute(mapping.getAttribute(), caForm);
        }
        errors = caForm.validate(mapping, request);
        if (errors.isEmpty()) {
            if (request.getParameter("caSelezionata") != null) {
                try {
                    CaVO ca = FirmaDigitaleDelegate.getInstance().getCaById(
                            NumberUtil.getInt(request
                                    .getParameter("caSelezionata")));
                    if (ReturnValues.FOUND == ca.getReturnValue()) {
                        caricaForm(caForm, ca);
                    } else {
                        errors.add("generale", new ActionMessage(
                                "firmadigitale.errore.ca_non_trovata"));
                    }
                } catch (DataException e) {
                    errors.add("generale", new ActionMessage(
                            "database.cannot.load"));
                }
            } else if (request.getParameter("importa") != null) {
                uploadCertificate(caForm, errors);
            } else if (request.getParameter("nuovo") != null) {
                caricaForm(caForm, new CaVO());
            } else if (request.getParameter("rimuoviCRL") != null) {
                rimuoviSelezionati(caForm);
            } else if (request.getParameter("aggiungiCRL") != null) {
                aggiungiCRL(caForm);
            } else if (request.getParameter("salva") != null) {
                try {
                    CaVO ca = new CaVO();
                    caricaModel(caForm, ca);
                    FirmaDigitaleDelegate.getInstance()
                            .salvaCertificateAuthority(ca);
                    ActionMessages msg = new ActionMessages();
                    msg.add("salvato", new ActionMessage(
                            "firmadigitale.ca.salvata"));
                    saveMessages(request, msg);
                } catch (DataException e) {
                    errors.add("generale", new ActionMessage(
                            "database.cannot.save"));
                }
            }
        }
        saveErrors(request, errors);
        return (mapping.findForward("input"));
    }
public ActionForward execute ( ActionMapping mapping , ActionForm form , HttpServletRequest request , HttpServletResponse response ) throws Exception { ActionMessages errors = new ActionMessages ( ) ; CertificateAuthorityForm caForm = ( CertificateAuthorityForm ) form ; if ( form == null ) { caForm = new CertificateAuthorityForm ( ) ; request . setAttribute ( mapping . getAttribute ( ) , caForm ) ; } errors = caForm . validate ( mapping , request ) ; if ( errors . isEmpty ( ) ) { if ( request . getParameter ( "caSelezionata" ) != null ) { try { CaVO ca = FirmaDigitaleDelegate . getInstance ( ) . getCaById ( NumberUtil . getInt ( request . getParameter ( "caSelezionata" ) ) ) ; if ( ReturnValues . FOUND == ca . getReturnValue ( ) ) { caricaForm ( caForm , ca ) ; } else { errors . add ( "generale" , new ActionMessage ( "firmadigitale.errore.ca_non_trovata" ) ) ; } } catch ( DataException e ) { errors . add ( "generale" , new ActionMessage ( "database.cannot.load" ) ) ; } } else if ( request . getParameter ( "importa" ) != null ) { uploadCertificate ( caForm , errors ) ; } else if ( request . getParameter ( "nuovo" ) != null ) { caricaForm ( caForm , new CaVO ( ) ) ; } else if ( request . getParameter ( "rimuoviCRL" ) != null ) { rimuoviSelezionati ( caForm ) ; } else if ( request . getParameter ( "aggiungiCRL" ) != null ) { aggiungiCRL ( caForm ) ; } else if ( request . getParameter ( "salva" ) != null ) { try { CaVO ca = new CaVO ( ) ; caricaModel ( caForm , ca ) ; FirmaDigitaleDelegate . getInstance ( ) . salvaCertificateAuthority ( ca ) ; ActionMessages msg = new ActionMessages ( ) ; msg . add ( "salvato" , new ActionMessage ( "firmadigitale.ca.salvata" ) ) ; saveMessages ( request , msg ) ; } catch ( DataException e ) { errors . add ( "generale" , new ActionMessage ( "database.cannot.save" ) ) ; } } } saveErrors ( request , errors ) ; return ( mapping . findForward ( "input" ) ) ; }
Process the specified HTTP request, and create the corresponding HTTP
 response (or forward to another web component that will create it).
Process the specified HTTP request and create the corresponding HTTP response ( or forward to another web component that will create it ) .
// visualizza Ca