Jan Haderka ha scritto:
For posterity:
the pattern for URIStartsWith to match exactly and only the home page
is /home$
Cheers,
Jan
Jan, are you sure?
** return uri.startsWith(this.getPattern()); **
http://dev.magnolia-cms.com/ref/4.2.3/magnolia-core/xref/info/magnolia/voting/voters/URIStartsWithVoter.html
No REGEX in URIStartsWithVoter, isn't it?
The trick is to use the URIPatternVoter with
* /home$ *
(I prefer to use /home?$, because I want also to handle /home/ path,
because oure proxy routes www.somedomain.com on /somedomain-home/
Matteo
***************************************************************
I would like to remember that using URIPatternVoter, the pattern
configured is NOT a regular expression.
But a regular expression is built upon that value.
EG:
pattern = /home?$
is converted by the voter in
/home<SINGLE_CHAR_PATTERN>$
where <SINGLE_CHAR_PATTERN> = [\\p{L}\\p{Mn}\\w!\"#$%&'*+,-./:;
<=>?...@`|~\\^\\(\\)\\{\\}\\[\\]]?
so, the pattern is converted in
/home[\\p{L}\\p{Mn}\\w!\"#$%&'*+,-./:; <=>?...@`|~\\^\\(\\)\\{\\}\\[\\]]?$
now it is a REGEX and it is used with
**
pattern.match(uri);
**
(See:
http://dev.magnolia-cms.com/ref/4.2.3/magnolia-core/xref/info/magnolia/voting/voters/URIPatternVoter.html)
HTH
Matteo
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------