Grails: Don't Run Filters on a Forward (without using flash variables) -


i'm writing plugin keeps track of pages user has visited in application (for purpose of button). having filter runs every controller/action , keeps list of visited pages. working great, except when used in applications use forwards, plugin records 2 entries 1 page since grails filters run on every request, when request forward (ie: internal redirect).

since plugin (that has application agnostic) can't set flash variable whenever forward used check if forward has occurred. there way determine if forward has occurred in filter? i'm exploring different values in request variable , how differ between normal request , forward, things can quite confusing. highly appreciated.

p.s. main difference noticed far request.forwarduri , request.requesturi differ forward, however, requesturi in special format don't know how convert match forwarduri.

for example normal request:

request.forwarduri = '/short-url' (as set in urlmappings) or '/controller/action request.requesturi = '/grails/controller/action.dispatch' 

for forward:

request.forwarduri = '/short-url' (as set in urlmappings) or '/controller/action' request.requesturi = '/grails/forwardedcontroller/forwardedaction.dispatch' 


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

c# - How do I get the Nth largest element from a list with duplicates, using LINQ? -

jsp - "Sending a redirect is forbidden after the response has been committed" in sendRedirect -