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 7022755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:37:22+00:00 2026-05-27T23:37:22+00:00

I have one requirement to fulfill. Actually when ever user Login into my application

  • 0

I have one requirement to fulfill.

Actually when ever user Login into my application , i will save the logged in user name in session attribute like .

session.setAttribute("LOGIN_USER", userName);

So that, if user tries to access my method links directly with out coming from Login page i can check in controller method whether this session has the specific attributive value as below and i can restrict user to access that page and redirect him to login page.

if(request.getSession(false).getAttribute("LOGIN_USER")==null)
 //redirect to login page

Now,my requirement is if i have 50 methods in controller i can’t add this condition in each method.I think there is a way we can add some sort of filters or any method in controller class like ex @preExecuteMethod to first execute this method and proceed for the actual call if success.

  • 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-05-27T23:37:23+00:00Added an answer on May 27, 2026 at 11:37 pm

    Yes, you can use a HandlerInterceptor for this. See the docs here and here.

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

Sidebar

Related Questions

I have one requirement in which User will have options to select languages for
I have one sharepoint application, in this i have to show the current user,
I have requirement like this, Have One NSIMageView and which will be changing frequently
I have one requirement in my android application in which I need to run
I have developed one application which will have activities and one background service and
I have integrated in-app Billing into my android app. And there is one requirement:
I have one requirement in C. char abc[]=hello; char hello[]=world; Using abc whether we
I have one requirement that i have to place the log file in the
I am developing native iPhone app. I have one requirement that, there are 5
I have one portal with 3 modules inside it, now my requirement is i

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.