Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm really do not care how about struts handles an exception. Using old raw code from 1.2 generally when overriding a <code>RequestProcesor</code>, I should probably replace the two methods - process and <code>processException</code>. First thing is happy about catching exception from the request after <code>processValidation</code> has been made. The fragment of code could look like</p> <pre><code>Exception exception = null; if (needValidation) try { if (! processValidate(request, response, form, mapping)) { return; } exception = (Exception)request.getAttribute(Globals.EXCEPTION_KEY); } catch (InvalidCancelException ex) { exception = ex; } ActionForward forward; // Check out if exception occurred if (exception != null){ forward = processException(request, response, exception, form, mapping); </code></pre> <p>The second is pretty easy if you have configured the errors forward. The errors forward is usually one of the global forwards that easily found from the mapping. Once it found, it likes to display your error message on the page. I think those would probably enough for processing an exception</p> <pre><code>exception.printStackTrace(); log.error(exception); request.setAttribute("error", exception.getMessage()); return mapping.findForward("error"); </code></pre> <p>It has been done because validate method from <code>ActionForm</code> or <code>ValidatorForm</code> doesn't throw any exceptions and I couldn't properly override this method without throwing some. Once thrown, who will care about it?! </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload