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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:53:05+00:00 2026-05-24T01:53:05+00:00

In my struts application, I want to selectively redirect some Users (based on their

  • 0

In my struts application, I want to selectively redirect some Users (based on their role) to a static page when they access some of the actions.

I am not looking for full fledged Authorization solution here, but my problem is very much similar.

Is there a way to put some flag or any other detail with an action in struts-config.xml which can be used in java code to identify if the actions fall in the category for which I want to deny access selectively?

NOTE: I do not directly extend org.apache.struts.action.Action for my actions. Instead I have defined an abstract class that extends org.apache.struts.action.Action and rest of the actions in my application extents this abstract class. Thus, I can perform validation here.
I can identify the type of action here using the mappings.getPath(). But I dont want to hardcode the list of paths that I want to selectively deny access, instead I am looking forward if this can be configured in struts-config.xml.

  • 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-24T01:53:06+00:00Added an answer on May 24, 2026 at 1:53 am

    This can be configured in the struts-config.xml file by using the roles attribute on the <action> configuration. You can specify the roles that your users should have to get access to that particular action.

    With this you can avoid doing the test on the mappings.getPath() (which I agree with you that it is an ugly solution).

    Once the roles configured, you could then create yourself a custom request processor to process those roles in whatever way you like.

    You can find more information on Struts’ security roles on the web, but here is a basic example to get you started.

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

Sidebar

Related Questions

I am working on a basic Struts based application that is experience major spikes
When a user signs up in our Struts application, we want to send them
I am developing a web application using Struts 1.2.7 I want to print a
I am developing an application in struts 1.2 framework. I want to use hibernate
It's a Struts application. I have to show some dynamic date in the left
In my struts application i want to pass the null value to the mapping.findForward('null')
I have a java based web application(struts 1.2). I have a requirement to display
I have an application built with Struts 2. It has some issues with Cross-site
I am designing a web application where i want to use maximum of struts
We have a web application where users can login. Now what we want is

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.