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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:41:00+00:00 2026-05-25T19:41:00+00:00

I would like to develop a small test multi-login application using Struts2 and JSP.

  • 0

I would like to develop a small test multi-login application using Struts2 and JSP. Basically:

  1. The application should have welcome page (i.e. index.jsp) anyone can access.

  2. This welcome page would have two login boxes: one for users and one for administrators.

  3. The web application should have two sub-applications, one for users, one for administrator. In other words, it is not a single application where logged-in users would have different privileges. Each sub-application would have their own secluded set of pages.

Struts2 uses the MVC pattern and I am wondering how I should use the filter pattern to organize this. I could have all requests under /userapp/* go to the user application and all requests under /adminapp/* go to the admin application.

My questions are:

  1. Is this the right strategy (i.e. best practice)? If yes, how should I implement this in my web.xml?

  2. Should I implement two filters and two mappings (if yes why?) or should I implement one filter and two mappings?

UPDATE

After doing a lot of reading, I get to understand that Struts2 multi-login is an over-engineered and too heavy solution for what I need. I have decided to implement my own Servlet 3.0 and use JQuery + Ajax.

  • 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-25T19:41:01+00:00Added an answer on May 25, 2026 at 7:41 pm

    Consider a case where there are 2 different users ‘Admin'(Highest Privileges) and ‘Customer(Less Privileges compared to Admin)’. In Struts,you can implement like this

    1.Make a Business Logic like User class which basically does the following tasks

      a.)Gets the username,password as input.
      b.)Checks whether this 'username' exists in database.
      c.)If exits, gets the type of user(either Admin or Customer) and checking 
         its corresponding password.
    

    2.Use this ‘User’ object from within ‘Action’ class.So,you pass the ‘ActionForm’ values(username,password) into this business method,validate the user and get a specific usertype(Storing in session).

    3.On subsequent requests made by this ‘User’,check the usertype and forward accordingly.Create a custom ‘Action’ class which always validates the usertype(and other validations) on each action received from a usertype. All your other ‘Action’ class should extend this custom ‘Action’ class.

    This is how i implemented in one of the my Struts web-application where more than 3 types of users with different rights.I never seen a separate url pattern for each user type.So it is better to show,
    http://www.yoursite.com/Process.action
    instead of http://www.yoursite.com/adminapp/Process.action

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

Sidebar

Related Questions

I would like to develop a small notifications application for Windows in .NET that
I would like to develop an application using Silverlight. As this application is used
I would like to develop Adobe Flex applications using Linux and a free environment.
I would like to develop a mobile application that is able to access all
I would like to develop a reusable UI control for iPhone. How should I
I have a task and would like to develop in my mind how i
I would like to develop an application similar to Thinix touch What tools would
I would like to use javascript to develop general-purpose GUI applications. Initially these are
I would like to use Apple's Xcode IDE to develop applications on the OS
I'm a C# developer. I develop both Windows & Web Applications. I would like

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.