Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring AOP pointcut with one certain argument
    primarykey
    data
    text
    <p>I need to create an aspect that I find hard to describe, so let me point out the ideas:</p> <ul> <li>any method within the package (or any subpackage) of com.x.y...</li> <li>one method argument is an implementation of an interface javax.portlet.PortletRequest</li> <li>there may me more arguments in the method</li> <li>they may be in any order</li> </ul> <p>I need a pointcut and an "around" advice with the PortletRequest given</p> <p>Currently I have smt like:</p> <pre><code>@Pointcut("execution(* com.x.y..*.*(PortletRequest,..)) &amp;&amp; args(request,..)") public void thePointcut(PortletRequest request) { } @Around("thePointcut(request)") public Object theAdvice(ProceedingJoinPoint joinPoint, PortletRequest request) { ... </code></pre> <p>and receive an error:</p> <blockquote> <p>ERROR 10:47:27.159 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] o.s.web.portlet.DispatcherPortlet - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet. mvc.HttpRequestHandlerAdapter': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: w arning no match for this type name: PortletRequest [Xlint:invalidAbsoluteTypeName]</p> </blockquote> <p>Any help highly appreciated</p> <p>Kind regards, Dan</p> <p><strong>UPDATE</strong> the method i'm trying to intercept is:</p> <p>in <strong>public class com.x.y.MainClass</strong> :</p> <p><code>public String mainRender(Model model, RenderRequest request) throws SystemException</code></p> <p>in <strong>public class com.x.y.asd.HelpClass</strong>:</p> <p><code>public final void helpAction(ActionRequest request, ActionResponse response, Model model)</code></p> <p>Of cource, I want to get the argument that implements PortletRequest, that is RenderRequest from the first method, and ActionRequest from the second.</p> <p>Regards, Dan</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.
 

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