Results 1 to 3 of 3

Thread: Using request.setAttribute in interceptor - good or bad? :)

  1. #1
    Join Date
    Oct 2004
    Posts
    151

    Default Using request.setAttribute in interceptor - good or bad? :)

    Hi!

    We have an object (a topicmap object) that is created in the beginning of the request (we create it in an interceptor) and it should live until the end of the request. It should be possible to access this object from handleRequest.

    Is using request.setAttribute in the interceptor a good way of doing this and the access this object with request.getAttribute in handleRequest? Or is this a misuse of the request.setAttribute method? Any better ways of doing this?

    TIA!


    -Kaj

  2. #2
    Join Date
    Aug 2004
    Location
    Toronto, ON, Canada
    Posts
    101

    Default

    What you describe sounds perfectly fine. The request attributes only have a short lifetime and are the way to pass things around in chained handlers or through interception.

    S.

  3. #3
    Join Date
    Oct 2004
    Posts
    151

    Default

    Goooood! Thanks for answering!


    -Kaj

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •