After looking in the spring code for placeholder resolution I found that
adding
setValueSeparator(null);
to the constructor solves the problem.
Also the method
protected String resolvePlaceholder(String placeholder, Properties
props)
{
try
{
return symbolSource.valueForSymbol(placeholder);
}
catch(RuntimeException e)
{
return super.resolvePlaceholder(placeholder, props);
}
}
Should be changed to
protected String resolvePlaceholder(String placeholder, Properties
props)
{
try
{
return symbolSource.valueForSymbol(placeholder);
}
catch(RuntimeException e)
{
return null;
}
}
This ensures that tapestry only adds it's own placeholders and does not
do some extra stuff (like replacing placeholders by system properties
and such) - if a user would like to do so, he should provide its own
PropertyPlaceholderConfigurer rather than rely on this side effect of
tapestry's SymbolBeanFactoryPostProcessor.
Hi,
I trapped into this issue:
https://issues.apache.org/jira/browse/TAP5-2176
"SymbolBeanFactoryPostProcessor breaks property placeholder in spring
when using default values".
My current workaround is to use a different "valueSeparator" for my
own PropertyConfigurer.
I'd like to provide a fix/patch for this issue but there are several
ways to do it which I'd like to discuss.
1. only resolve properties that begins with "tapestry." as suggested
in the bug
2. disable default-value validation by using a very uncommon
"valueSeparator" instead of the default ":"
3. wait that https://jira.spring.io/browse/SPR-9989 is fixed -
probably never ;-)
IMO 1 has the disadvantage that custom symbols cannot be used anymore
So I'd prefer 2 as a solution. Preventing
SymbolBeanFactoryPostProcessor to resolve ":" separated default values
is not a problem since every other configured
PropertyPlaceholderConfigurer in the context would to the job.
--
Mit freundlichen Grüßen / Kind regards
Michael Wyraz
evermind GmbH
Schorlemmerstraße 1
04155 Leipzig
Tel.: +49 (0)341-25 39 66 - 0
Fax: +49 (0)341-25 39 66 - 1
Funk: +49 (0)177-73 00 00 3
E-Mail: michael.wy...@evermind.de
HRB: 21586
Amtsgericht Leipzig
Geschäftsführer:
Christoph Klemm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tapestry.apache.org
For additional commands, e-mail: dev-h...@tapestry.apache.org