Results 1 to 2 of 2

Thread: Accessing data model set defined in a controller using a servlet filter

  1. #1
    Join Date
    Dec 2008
    Posts
    2

    Default Accessing data model set defined in a controller using a servlet filter

    Hello All,

    Is there a way to access a data model set in the spring mvc controller using a servlet filter?

    For example:
    ------------

    If i have a data model "testObject" defined in a spring mvc controller

    theModelAndView.addObject("test", testObject);

    How to get the reference of "testObject" in a servlet Filter.?

    Thanks in advance.

    Jay

  2. #2
    Join Date
    Dec 2008
    Posts
    2

    Default

    OK, the issue was because of the URL mapping for the servlet filter.
    By applying the filter only to the specific URL, I was able to access the model data just by using request.getAttribute("modelObjName")

    Jay

Posting Permissions

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