aspose file tools*
The moose likes Servlets and the fly likes how to avoid multiple  request attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to avoid multiple  request attribute " Watch "how to avoid multiple  request attribute " New topic
Author

how to avoid multiple request attribute

Munish Dabra
Greenhorn

Joined: Nov 18, 2003
Posts: 19
I need to setup something more generic on application level for the scenario mentioned:

Any of my actions/Jsp can optionally set One or more particualr request attribute keys (different user ids etc ), on the basis of which I need to check some data specific security (to match the userid with current logged user )in AppGlobalAction(all action extends this action).
What I dont like is to get all these request attribute in AppGlobalAction and check everytime although we need this data specific security thing for only few actions.
Other thing Is there any better way to achieve this thing. Can we set request attibute in our action as an array or something like that . I dont want to define so many attribute with different names and check them all the time?


Munish Dabra<br />SCJP , SCWD
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30309
    
150

Munish,
Take a look at servlet filters. You can do all the security checks in one place that way.

Also, you can put a SecurityUser object in the session instead of passing everything around in request attributes.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to avoid multiple request attribute