Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8462765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:15:36+00:00 2026-06-10T14:15:36+00:00

Classes use compile time weaving. Imagine I have the aspect class: @Aspect public class

  • 0

Classes use compile time weaving.

Imagine I have the aspect class:

@Aspect
public class SecurityInterceptor {

    @Pointcut("within(@org.springframework.stereotype.Controller *)")
    public void beanAnnotatedWithController() {}

    @Pointcut("execution(public * *(..)) && args(*,httpReq)")
    public void publicMethods(HttpServletRequest httpReq) {}

    @Pointcut("beanAnnotatedWithController() && publicMethods(httpReq)")
    public void controllerMethods(HttpServletRequest httpReq) {}

    @Pointcut("execution(public * *(..)) && args(httpReq)")
    public void publicMethodsRequestOnly(HttpServletRequest httpReq) {}

    @Pointcut("beanAnnotatedWithController() && publicMethodsRequestOnly(httpReq)")
    public void controllerMethodsOneArg(HttpServletRequest httpReq) {}


    @Around(value = "controllerMethods(httpReq)")
    public Object populateSecurityContext(final ProceedingJoinPoint joinPoint, HttpServletRequest httpReq) throws Throwable {
        return popSecContext(joinPoint, httpReq);
    }

    @Around(value = "controllerMethodsOneArg(httpReq)")
    public Object populateSecurityContextOneArg(final ProceedingJoinPoint joinPoint, HttpServletRequest httpReq) throws Throwable {
        return popSecContext(joinPoint, httpReq);
    }

}

What is the correct way to use @DeclarePrecedence to determine the execution order?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:15:38+00:00Added an answer on June 10, 2026 at 2:15 pm

    Please read paragraph “Advice precedence” in the language semantics section of the AspectJ documentation.

    Precedence of aspects can be declared explicitly, precedence of advice within a single aspect is determined by rules described in the document and cannot be changed, AFAIK. So @DeclarePrecedence will not help you in this case, only changing the order of advice within the aspect file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm defining a DU for the various classes I use within HTML: type Class
I have two Classes : class Customer { public string Fullname { get; set;
I have two classes Hello1 and Hello, and I'm calling class Hello1 constructor within
I have a relationship between two base classes: public abstract class RecruiterBase<T> { //
I frequently find myself creating classes which use this form (A): abstract class Animal
I have a number of simple controller classes that use Doctrine's entity manager to
I have a bunch of third-party Java classes that use different property names for
I have some NSManagedObject classes created for use with CoreData I need to add
I have implemented some utility classes in Flex that I want to use in
I want to use compile-time AspectJ with Ant in NetBeans . I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.