Hello,

I want to send an email when an exception occurs and inside the mailbody the exception stacktrace must be written. So I thought to make an action "action-sendmail" and call it from the map:handle-errors part. That definitely triggers the action but how can I send the Exception object (or just the errormessage and its stacktrace to that action so I can place it into the mailbody.

Can the Exception object been sent thru a parameter? Where is the exception located? Inside the request object?

See below a snippet of the sitemap

Any help is welcome,

Regards,
Gunter D'Hondt
SOFICO NV Belgium.


    <map:handle-errors>
      <map:select type="exception">
        <map:when test="not-found">
          <map:generate type="notifying"/>
          <map:transform src="">
            <map:parameter name="contextPath" value="{request:contextPath}"/>
            <map:parameter name="pageTitle" value="Page not found"/>
          </map:transform>
          <map:serialize status-code="404"/>
        </map:when>

        <map:when test="invalid-continuation">
          <map:generate src="">
          <map:transform src="">
            <map:parameter name="contextPath" value="{request:contextPath}"/>
          </map:transform>
          <map:serialize status-code="404"/>
        </map:when>

        <map:otherwise>
          <map:act type="action-sendmail"/>
          <map:generate type="notifying"/>
          <map:transform src="">
          <map:serialize status-code="500"/>
        </map:otherwise>
      </map:select>

    </map:handle-errors>

Reply via email to