On Thu, Mar 4, 2010 at 13:56, Sergiu
Dumitriu<sergiu(a)xwiki.com> wrote:
On 03/04/2010 10:54 AM, Thomas Mortagne wrote:
On Wed, Mar 3, 2010 at 13:48, sdumitriu
<platform-notifications(a)xwiki.org> wrote:
> Author: sdumitriu
> Date: 2010-03-03 13:48:22 +0100 (Wed, 03 Mar 2010)
> New Revision: 27429
>
> Modified:
> platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/Utils.java
> Log:
> XWIKI-4955: Page with empty content leads to "This template does not exist"
message when viewed in plain mode
> Revert the trim() removal, which makes all the validation tests fail
Then the wrong template should be fixed instead of putting a hack...
It is not a hack, and there is not one wrong template. All the templates
There is 16 wrong templates plus macro template itself is wrong and
for most of them it's just one line that needs ##.
generate whitespaces. I still believe that there
is absolutely no reason
A template don't have to generate white spaces and the issue are not
all templates that generated whites spaces, we just need to fix
templates that generate white space before the actual xhtml content
(i.e. before "<?xml..." in htmlheader.vm),
not to use the trim(), since nobody cares if the
whitespace reaches the
The problem is that you only think about full xhtml content, in that
case yes we don't care about triming that content but that's not our
only use case. You could write templates that return some content you
want to get exactly like it was. An example: you need to write a
service in a document to return the exact content of an object or the
content of the document, with this you will be forced to inject
directly your content in the response object and use
$context.setFinished(true) which is a pain.
Sending plain content is not the only option. You can (and should) put
it in a wrapper, either XML or JSON.