struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Lindholm <greg.lindh...@gmail.com>
Subject Re: Catch all method for actions?
Date Tue, 11 May 2010 16:01:41 GMT
You can add a default action to catch any random hits

    <default-action-ref name="Unknown" />

    <action name="Unknown" class="xxx.struts.UnknownAction">
      <interceptor-ref name="unknownActionStack" />
      <result>Error.jsp</result>
    </action>


On Tue, May 11, 2010 at 11:34 AM, Mitch Claborn <mitch@claborn.net> wrote:
> A security scan on our site is sending a request like
>
> /emailalink!"Xx<XaXaXXaXaX>xX.html
>
> which produces an exception
> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor
> com.csc.mm.web.action.EmailLink."Xx<XaXaXXaXaX>xX()
> java.lang.NoSuchMethodException:
> com.csc.mm.web.action.EmailLink."Xx<XaXaXXaXaX>xX()
>        at java.lang.Class.getMethod(Unknown Source)
>        at
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:75)
>        at
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)
>        at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
>        at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>        at
> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
>        at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>        at
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
> etc
>
> I'd like to be able to somehow capture those requests into a catch-all or
> default method on the action so that I can do something intelligent, rather
> than just allowing an error page to show up.  Is there a way to do this?
>
>
>
> Mitch
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message