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

  • Home
  • SEARCH
  • 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 8475691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:57:41+00:00 2026-06-10T17:57:41+00:00

I used a lot annotations in java but I never wrote one. I read

  • 0

I used a lot annotations in java but I never wrote one. I read though several guides and I am really confused.

They are using annotations like meta information eg names, age etc. That is really confusing because I want to do something different

http://www.developer.com/java/other/article.php/3556176/An-Introduction-to-Java-Annotations.htm

I want to control the function calls.

for example

@Permission(user)
public static void account(){
...
} 

So my functions only gets called if the user has the permission, otherwise the user should be redirected to the login page.

I could not find any information, maybe I am using the wrong keyword?

I hope you can clear things up,

Thanks.

  • 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-10T17:57:42+00:00Added an answer on June 10, 2026 at 5:57 pm

    You can do that, but with a lot of extra code. Intercepting method calls is part of AOP (aspect oriented programming). You need to make proxies of you target objects, and in the invocation handler parse the annotation.

    Luckily, you don’t have to do that – since you have a webapp, just use spring/spring-mvc/spring-security. Spring gives you an AOP framework that you can use to define aspects handling your permission logic

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

Sidebar

Related Questions

I've used MySQL (via PHPMyAdmin) a lot before but never really understood half of
I used to work in JavaScript a lot and one thing that really bothered
The term test case used a lot, but what does it actually mean? Test
The Keychain seems to be used a lot for usernames and passwords, but is
I've followed a lot of the guides and forum posts online but haven't had
I havent used a lot of static methods before, but just recently I tend
I've used a lot of other techniques for reading pixel data from files but
I see it used a lot, but haven't seen a definition that makes complete
We've got into a very tricky scenario in a project. We have used lot
I see it used a lot in context of data. From ScottGu's post :

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.