Andreas, the second method is definitely better from the perspective of long-term maintainence. You really need just 1 jsp to achieve the task at hand. Also, using tags should not make the code unreadable since tags were developed for exactly that purpose. They embed nicely with markup. If you were using a scriplet then readability would be an issue. Another option is to check for the role in an action and then forward the user to the appropriate page depending on their role. This will also require more than 1 jsp.

- Asad


On Tue, 17 Oct 2006, [EMAIL PROTECTED] wrote:


Hello!

I have to restrict some of my sites according to the role the logged in user
has. There will be a role of admin or user and possibly some more.

How could it be done best?

1. Implementing an own jsp-file for each existing jsp with the reduced roles:
each role would have its own jsp-file.

2. Wrapping the restricted areas with <logic:equal> tags to check, wheter the
area should be displayed or not.

3. ?


I fear that the second way will lead to unreadable (and unmaintainable)
jsp-files. The first way would produce more jsp-files, but they would be less
complicated (no additional checks, therefore producing less CPU load). They
could be much easily be maintained, because it's evident, where to search a
problem or where to extend a new feature.


Does anybody has an additional idea?

Kind regards,
Andreas Hartmann


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to