0

I am working on a struts 1.3 web application that has 2 interfaces one for regular staff and another for probationary staff. These can be looked at as 2 modules having some interfaces in common and some others that are different.

Instead of putting authorization rules on the application, I was wondering if I can control access to some resources using multiple configuration files. I need to implement the following behaviour:

For urls like /application/regular/* the application should use the struts-regular-config.xml file to work out the mapping. For urls like /application/probationary/* it should user the struts-prob-config.xml file to work out the mapping.

So effectively I need the action servlet to work with 2 different config files one each for the 2 url-patterns that I have. How can this be done? Many thanks in advance.

Shreyos Adikari
  • 12,348
  • 19
  • 73
  • 82
Anurag Joshi
  • 235
  • 1
  • 4
  • 17
  • Multiple config files you should configure simultaneously unless you are using modules. – Roman C Mar 10 '14 at 21:35
  • I can add multiple config files that is not an issue. What I want is to have multiple url-patterns. Based on the url-pattern the action path should be resolved using the corresponding config file. For e.g. if it is /application/regular/login the page should display regular-login.jsp and if it is /application/prob/login it should display prob-login.jsp – Anurag Joshi Mar 11 '14 at 04:15

1 Answers1

0

Try This Approach Instead of creating different/multiple URL pattern and URLs for different users.

  • Use the same URL for all the users.Divide your Projects into modules and sub modules using AJax tags.
  • Create one new Class RolePermission which will define Roles and permission for Different Users. For eg, whether User A has access to Module X or not.

Also use this parameter/fields like RoleId, RoleName,isAllowed,securityGroup for defining RolesPermission.

Yagnesh Agola
  • 4,556
  • 6
  • 37
  • 50