Sorry, I forgot to include a code snippet from my Action ( /admin/news )

My edit method is:

public ActionForward edit (
    ActionMapping          mapping,
    ActionForm             form,
    HttpServletRequest     request,
    HttpServletResponse    response )
        throws Exception
{
    ActionErrors        errors = form.validate ( mapping, request );
    ActionForward       forward = null;
                
    if ( errors == null || errors.isEmpty () ){
        SnuskService    service = getService ();
        request.setAttribute ( "current", service.getNewsItem ( 1 ) );
        forward = mapping.findForward ( "Edit" );
    }else{
        forward = list ( mapping, form, request, response );
    }
                
    return forward;
}

My intention is that if someone is tampering with the URL, they should just go back to the news list and have an error displayed. This was the simplest thing I could think of to start with :)

regards,
/Magnus Sjöstrand

Luis Urueña Frías wrote:
Hello:

    To perform a validation over an action, it's required to enable the
validation attribute, is'n it?

validate=true like follows

<action path="/admin/news"
    parameter="method"
    type="com.snusk.actions.admin.NewsAction"
    name="EditNewsForm"
    validate="true"
    scope="request">
  [ some forwards ]
</action>

Regards

Luis Urueña Frías Oficina 101
Edificio Galileo, módulo Rojo
Parque Tecnológico de Boecillo
Valladolid - España



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to