[MAGNOLIA-1196] Using MagnoliaFilterChain as <dispatcher>FORWARD</dispatcher> could crash the system Created: 09/Nov/06  Updated: 23/Jan/13  Resolved: 01/Nov/07

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 3.0 RC3
Fix Version/s: 3.5 RC1

Type: Bug Priority: Major
Reporter: Filippo Fratoni Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File FilterStubCms.java     Text File log.txt    
Issue Links:
dependency
depends upon MAGNOLIA-1698 Review usage of originalURI/currentUR... Closed
depends upon MAGNOLIA-1776 Changing template renderers in order ... Closed
is depended upon by MAGNOLIA-1185 Provide a generic bypass mechanism fo... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

/DocSpesaFrom.html is my page
/templates/jsp/docSpesaForm.jsp is the template associated with my page

When I call my page what happens is>
1)cms filter handle requestURI /DocSpesaFrom.html and forward to /templates/jsp/docSpesaForm.jsp
2)again in the cms filter. It should handle(skip in my case) /templates/jsp/docSpesaForm.jsp but Path.getURI(request) return "/DocSpesaFrom.html", we are back to step 1) end here loop starts.

I resolved this problem introducing this few trivial lines in MgnlCmsFilter.doFilter():
// Introduced to allow request forward when dispatching filters
// If Path class find "MGNL_REQUEST_URI_DECODED" attribute, cms filter loop
// If Path class miss it, the attribute gets aligned with current requestURI
if (req.getAttribute("CHECK_FWD") != null)

{ log.debug("Already been in Filter Cms"); req.removeAttribute(MGNL_REQUEST_URI_DECODED);}

else

{ log.debug("First time in Filter Cms"); req.setAttribute("CHECK_FWD", new Integer(0)); }

 Comments   
Comment by Filippo Fratoni [ 09/Nov/06 ]

This is my custom filter

Comment by Filippo Fratoni [ 09/Nov/06 ]

A log snapshot. You can see that requestURI is unchanged across a forward.

Comment by Philipp Bracher [ 17/Nov/06 ]

I assignet it to 3.0.x, we should think about defining the dispatching of filter by ourself. This could solve problems like setting of a context, creating form object in case of forwarding, including of jsps.

Comment by Fabrizio Giustina [ 01/Nov/07 ]

Fixed by MAGNOLIA-1698

Generated at Mon Feb 12 03:24:35 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.