0
votes

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.

1
Multiple config files you should configure simultaneously unless you are using modules. - Roman C
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 <server>/application/regular/login the page should display regular-login.jsp and if it is <server>/application/prob/login it should display prob-login.jsp - Anurag Joshi

1 Answers

0
votes

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.