Dave:
One way to get Struts to rewrite action paths with more context is to use modules; if your users really stay "within" an area, then using Modules to partition your app will result in all Struts URL rewriting to prepend the paths with both the servlet context path and the module context path.
But as I'm absorbing your application design, I'm not sure I see why you have different paths; if you want to reuse the same pages and if the behavior is essentially the same, then why not establish a "group identifier" in the session at user authentication time, and then just use a single tree of behaviors in which all the code is aware that users have group IDs and that the code's behavior is likely to be dependent on the value of that ID.
Have I oversimplified your app? Even if you can come up with exceptions, you still might be better off shifting the awareness of groups into code and out of the config.
Does this help?
Joe
At 8:38 PM -0500 9/2/04, Dave Bender wrote:
I'm new to Struts and liking it so far. But I'm stumped on how I can get a user of my web application to stay in the same subdirectory throughout the workflow without going through a lot of hoops.
Here's what I mean. Our application will be used by 100 people divided into six work groups. Each group has access only to their section of the web site. And each section of the web site will have about five different functions, for example an upload a file section, an Events listing section, an bulletin board section.
The code/functionality in each section is identical from group to group, so I want to use the same set of JSPs and Actions for each group. (That re-use thing.)
To make the security managable, I've organized the site (and corresponding URLs) in a directory hierarchy like this:
/app1/areas/group1/section1 /app1/areas/group1/section2 /app1/areas/group1/section3 ... /app1/areas/group2/section1 /app1/areas/group2/section2 /app1/areas/group2/section3 ...
Where I'm having trouble is staying in the same section. If a member of group1 goes to section1, and my actions are defined like this :
<action forward="input.jsp" path="input" />
that takes the user to /app1/input.do, which is outside the "section". If I change my actions to specify the absolute path for each Action, it works, but I have to create six sets of actions, one for each section, like this:
<action forward="input.jsp" path="/app1/areas/group1/section1/input" />
That works, but ... is that how I'm *supposed* to to do it? I'm just getting started and I've got a butt-load of Actions. I don't want to manage them in sextuples. That seems repetitive and error prone, along with being a maintenance headache.
Any help would be appreciated. It seems like this problem must have been solved elegantly somehow, but I'm lost as to how.
Dave
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place."
- Carlos Santana
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]