You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Allen <da...@mojavelinux.com> on 2003/06/25 08:15:09 UTC

ActionFilter captures requestUri

When it comes to pagination, there are two solutions.  Either put
the dataset in the session and let the taglib return to the jsp on
incremental pages or put the dataset in the request from the action
each time (or a third one would be to return to the action, but
check for the dataset's existence in the session and don't retrieve
it again).

The authors of the taglib libraries suggest to put the dataset in
the session and then let the taglib return directly to the jsp.
However, with struts this really doesn't work that well since it
breaks tile controllers and bypasses necessary security (direct
access to the jsp is dangerous when it is working with data sets).

Now, my solution.  I came up with this idea and I want to see if
anyone likes it.  I already have an ActionFilter that initializes
the remote user's info bean and opens a hibernate session.  I am now
using that filter to grab the request.getRequestURI() at the point
when it is still registered as the struts action path and I put it
into the request as actionURI.  Now, in my pager library I can use
that request object in place of the jsp path, which is what the
getRequestURI returns by the time I am working with the taglib.  I
have a constant ACTION_URI in the filter which I use when placing it
into the request.

Who likes that idea?

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"While they're pumping, you're soaking them" 
 -- Speed Loader TV Advert
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org