Wrong decorator selected

50 views
Skip to first unread message

mschipperheyn

unread,
Feb 3, 2014, 11:10:13 AM2/3/14
to sitemes...@googlegroups.com
Hi,

I have two decorators

<mapping path ="/*/??_??/account/**" decorator="/WEB-INF/decorators/single_column.ftd"/>

<mapping path ="/*/??_??/*/user/profile/edit/*/" decorator="/WEB-INF/decorators/smallest_column.ftd"/>

When I use the url /brasil/BR_pt/account/user/profile/edit/skill/, the first one is selected where I would expect the second one to be selected.

Both are matching, and the second one is longer, so I would assume it to be thought of as more specific. How to handle conflicting decorators best?

Marc

Ashish Chudasama

unread,
Feb 4, 2014, 4:31:33 AM2/4/14
to sitemes...@googlegroups.com
HI Marc,

Decorator always matched the longest pattern among the declared decorators. The reason what I understood from the source code is when there are several decorators which satisfied the pattern with respect to current url then selection logic prefered the longest pattern. this rule seems to be simplify the collision and priorities the  longest expression else complex logic needs to be build to resolve the best pattern which increase additional processing for each request in worst scenario.


Example :
when you specified /* pattern which means its default decorators that we have to apply for all url but exceptional one handle using more specific pattern. 
Reply all
Reply to author
Forward
0 new messages