Re: trimSpaces removing whitespace from html

2017-06-06 Thread Mark Thomas
On 29/05/17 09:43, Mark Thomas wrote:
> On 29/05/17 09:09, David Kavanagh wrote:
>> On 26 May 2017 at 22:33, Christopher Schultz 
>> wrote:
>>
>> Mark,
>>
>> On 5/26/17 6:59 AM, Mark Thomas wrote:
> 
> 
> 
> This is a potential use case for a recently closed (as WONTFIX)
> enhancement request:
>
> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
>
> Whether this use case is sufficient to justify re-opening that
> enhancement request, reviewing the patch and updating it for 9.0.x
> is TBD. How realistic is it for you to apply the fix (using ${'
> '}) described above?
>>
>> Would it be reasonable to change trimSpaces so that spaces within
>> element attributes would be normalized to a single space, and others
>> would be removed? I'm not sure how aware the parser is of the
>> surrounding document structure.
>>
>> -chris
> 
> 
> 
>> Hey guys,
>>
>> Thanks again for the help. For the Tomcat setup we currently have, the
>> first link sent my Mark is a good fix for us.
>> The other option Mark posted that would require modifying the .jsp files is
>> unfortunately not realistic because we currently use thousands of .jsps.
>> The possible fix that Christopher suggested in the last message would be
>> the perfect solution.
> 
> BZ 45931 it is then. Please re-open that enhancement request and link to
> this thread as the use case that justifies it. If you wanted to take a
> look at porting the patch as well, that would be great.

This has now been fixed for 9.0.x and will be included in 9.0.0.M22 onwards.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-29 Thread Mark Thomas
On 29/05/17 13:00, Konstantin Kolinko wrote:
> 2017-05-29 11:43 GMT+03:00 Mark Thomas :
>> On 26/05/17 21:33, Christopher Schultz wrote:



>>> Would it be reasonable to change trimSpaces so that spaces within
>>> element attributes would be normalized to a single space, and others
>>> would be removed? I'm not sure how aware the parser is of the
>>> surrounding document structure.
>>
>> The parser is completely unaware. As far as it is concerned, it is just
>> template text. Parsing the template text it is likely impossible since
>> correct parsing depends on evaluating the entire page.
> 
> Aren't EL expressions a part of that template text?

No. You want to work from the EBNF Grammar (section JSP.1.3.10.1) rather
than the text descriptions. It is much more precise.



> Jasper option "trimSpaces" is documented as
> "Should white spaces in template text between actions or directives be
> trimmed ?, default false."
> http://tomcat.apache.org/tomcat-8.5-doc/jasper-howto.html

That is poorly worded. It would be better if it stated that if true, it
effectively forces the trimDirectiveWhitespaces page directive to true
for every page and tag.



> JSP.8.5.1 The tag Directive
> 
> 
> trimDirective-
> Whitespaces
> (optional) Carries the same syntax and semantics of the trim-
> DirectiveWhitespaces attribute of the page directive.
> However, there is no corresponding global configuration
> element in web.xml.
> 
> 
> Thus the global configuration should not apply to tag files at all?

When it uses the word 'global' in this case, it means all JSP files
defined by a  element in web.xml. There is no
equivalent web.xml configuration option for tag files.


When we add this new option, I don't think the new value should override
and explicit per page or per tag directive to remove whitespace completely.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-29 Thread Konstantin Kolinko
2017-05-29 11:43 GMT+03:00 Mark Thomas :
> On 26/05/17 21:33, Christopher Schultz wrote:
>> Mark,
>>
>> On 5/26/17 6:59 AM, Mark Thomas wrote:
>>> On 26/05/17 10:15, David Kavanagh wrote:
 Hey guys,

 Thanks for getting back to me. I didn't realise that the
 attachments would be stripped.> Here are the two files in full.
>>
>>> That isn't enough for us to reproduce it. Those files refer to a
>>> handful of other tag files and classes we don't have.
>>
>>> However, I have been able to derive a simple test case from it:
>>
>>> =start== This is a test
>>> ==end===
>>
>>> The output with trimSpaces enabled is:
>>
>>> =start== This is a test
>>> ==end===
>>
>>> trimSpaces is behaving exactly as designed. It removes any blocks
>>> of template text that consist solely of white space.
>>
>>> What you have is: TemplateText [This is a test]
>>
>>> Because the second template text is empty, it gets removed.
>>
>>> The fix is:
>>
>>> =start== This is a
>>> test ==end===
>>
>>> This is a potential use case for a recently closed (as WONTFIX)
>>> enhancement request:
>>
>>> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
>>
>>> Whether this use case is sufficient to justify re-opening that
>>> enhancement request, reviewing the patch and updating it for 9.0.x
>>> is TBD. How realistic is it for you to apply the fix (using ${'
>>> '}) described above?
>>
>> Would it be reasonable to change trimSpaces so that spaces within
>> element attributes would be normalized to a single space, and others
>> would be removed? I'm not sure how aware the parser is of the
>> surrounding document structure.
>
> The parser is completely unaware. As far as it is concerned, it is just
> template text. Parsing the template text it is likely impossible since
> correct parsing depends on evaluating the entire page.

Aren't EL expressions a part of that template text?

=

Reading JSP 2.3 spec, there is

ch. JSP.1.9 Template Text Semantics
says that template text is uninterpreted

but
ch. JSP.2.2 Expressions and Template Text
says that EL can be used in template text.

ch. JSP.10.1.12 Template Text and XML Elements
talks about EL expressions that a part of template text

>From JSP.10.1.12 when mapping JSP pages into XML view,
the template text is mapped into  elements,
preserving EL expressions within the text.

=

The option that controls removal of whitespaces is called
"trimDirectiveWhitespaces".

Option of %@page directive is defined as


Indicates how whitespaces in template text should be
handled. If true, template text that contains only whitespaces
is removed from the output. The default is not to trim
whitespaces. This attribute is useful to remove the
extraneous whitespaces from the end of a directive that is not
followed by template text. The corresponding JSP
configuration element is trim-directive-whitespaces (see
Section JSP.3.3.8, “Removing whitespaces from template
text”). The attribute is ignored by JSP documents (XML
syntax).


Configuration option is defined in
JSP.3.3.8 Removing whitespaces from template text

The example in JSP.3.3.8 shows how whitespace is removed between
directives (<%..., JSP.1.10 Directives),
but there is no example of removing whitespace between EL.

There is also no example whether this option applies to custom tags
(aka JSP.1.13 Actions).

Jasper option "trimSpaces" is documented as
"Should white spaces in template text between actions or directives be
trimmed ?, default false."
http://tomcat.apache.org/tomcat-8.5-doc/jasper-howto.html

=

JSP.8.5.1 The tag Directive


trimDirective-
Whitespaces
(optional) Carries the same syntax and semantics of the trim-
DirectiveWhitespaces attribute of the page directive.
However, there is no corresponding global configuration
element in web.xml.


Thus the global configuration should not apply to tag files at all?

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-29 Thread David Kavanagh
Here is the link to the enhancement request.

https://bz.apache.org/bugzilla/show_bug.cgi?id=45931

Thanks

On 29 May 2017 at 13:32, David Kavanagh  wrote:

>
>
> On 29 May 2017 at 10:43, Mark Thomas  wrote:
>
>> On 26/05/17 21:33, Christopher Schultz wrote:
>> > Mark,
>> >
>> > On 5/26/17 6:59 AM, Mark Thomas wrote:
>> >> On 26/05/17 10:15, David Kavanagh wrote:
>> >>> Hey guys,
>> >>>
>> >>> Thanks for getting back to me. I didn't realise that the
>> >>> attachments would be stripped.> Here are the two files in full.
>> >
>> >> That isn't enough for us to reproduce it. Those files refer to a
>> >> handful of other tag files and classes we don't have.
>> >
>> >> However, I have been able to derive a simple test case from it:
>> >
>> >> =start== This is a test
>> >> ==end===
>> >
>> >> The output with trimSpaces enabled is:
>> >
>> >> =start== This is a test
>> >> ==end===
>> >
>> >> trimSpaces is behaving exactly as designed. It removes any blocks
>> >> of template text that consist solely of white space.
>> >
>> >> What you have is: TemplateText [This is a test]
>> >
>> >> Because the second template text is empty, it gets removed.
>> >
>> >> The fix is:
>> >
>> >> =start== This is a
>> >> test ==end===
>> >
>> >> This is a potential use case for a recently closed (as WONTFIX)
>> >> enhancement request:
>> >
>> >> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
>> >
>> >> Whether this use case is sufficient to justify re-opening that
>> >> enhancement request, reviewing the patch and updating it for 9.0.x
>> >> is TBD. How realistic is it for you to apply the fix (using ${'
>> >> '}) described above?
>> >
>> > Would it be reasonable to change trimSpaces so that spaces within
>> > element attributes would be normalized to a single space, and others
>> > would be removed? I'm not sure how aware the parser is of the
>> > surrounding document structure.
>>
>> The parser is completely unaware. As far as it is concerned, it is just
>> template text. Parsing the template text it is likely impossible since
>> correct parsing depends on evaluating the entire page.
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
> Hey,
>
> I reopened the enhancement request BZ 45931, and linked to this thread as
> you asked.
> I will look into porting the patch now also. The help is much appreciated.
>
> Thanks
>


Re: trimSpaces removing whitespace from html

2017-05-29 Thread David Kavanagh
On 29 May 2017 at 10:43, Mark Thomas  wrote:

> On 26/05/17 21:33, Christopher Schultz wrote:
> > Mark,
> >
> > On 5/26/17 6:59 AM, Mark Thomas wrote:
> >> On 26/05/17 10:15, David Kavanagh wrote:
> >>> Hey guys,
> >>>
> >>> Thanks for getting back to me. I didn't realise that the
> >>> attachments would be stripped.> Here are the two files in full.
> >
> >> That isn't enough for us to reproduce it. Those files refer to a
> >> handful of other tag files and classes we don't have.
> >
> >> However, I have been able to derive a simple test case from it:
> >
> >> =start== This is a test
> >> ==end===
> >
> >> The output with trimSpaces enabled is:
> >
> >> =start== This is a test
> >> ==end===
> >
> >> trimSpaces is behaving exactly as designed. It removes any blocks
> >> of template text that consist solely of white space.
> >
> >> What you have is: TemplateText [This is a test]
> >
> >> Because the second template text is empty, it gets removed.
> >
> >> The fix is:
> >
> >> =start== This is a
> >> test ==end===
> >
> >> This is a potential use case for a recently closed (as WONTFIX)
> >> enhancement request:
> >
> >> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
> >
> >> Whether this use case is sufficient to justify re-opening that
> >> enhancement request, reviewing the patch and updating it for 9.0.x
> >> is TBD. How realistic is it for you to apply the fix (using ${'
> >> '}) described above?
> >
> > Would it be reasonable to change trimSpaces so that spaces within
> > element attributes would be normalized to a single space, and others
> > would be removed? I'm not sure how aware the parser is of the
> > surrounding document structure.
>
> The parser is completely unaware. As far as it is concerned, it is just
> template text. Parsing the template text it is likely impossible since
> correct parsing depends on evaluating the entire page.
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
Hey,

I reopened the enhancement request BZ 45931, and linked to this thread as
you asked.
I will look into porting the patch now also. The help is much appreciated.

Thanks


Re: trimSpaces removing whitespace from html

2017-05-29 Thread Mark Thomas
On 26/05/17 21:33, Christopher Schultz wrote:
> Mark,
> 
> On 5/26/17 6:59 AM, Mark Thomas wrote:
>> On 26/05/17 10:15, David Kavanagh wrote:
>>> Hey guys,
>>>
>>> Thanks for getting back to me. I didn't realise that the
>>> attachments would be stripped.> Here are the two files in full.
> 
>> That isn't enough for us to reproduce it. Those files refer to a
>> handful of other tag files and classes we don't have.
> 
>> However, I have been able to derive a simple test case from it:
> 
>> =start== This is a test 
>> ==end===
> 
>> The output with trimSpaces enabled is:
> 
>> =start== This is a test 
>> ==end===
> 
>> trimSpaces is behaving exactly as designed. It removes any blocks
>> of template text that consist solely of white space.
> 
>> What you have is: TemplateText [This is a test]
> 
>> Because the second template text is empty, it gets removed.
> 
>> The fix is:
> 
>> =start== This is a
>> test ==end===
> 
>> This is a potential use case for a recently closed (as WONTFIX) 
>> enhancement request:
> 
>> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
> 
>> Whether this use case is sufficient to justify re-opening that 
>> enhancement request, reviewing the patch and updating it for 9.0.x
>> is TBD. How realistic is it for you to apply the fix (using ${'
>> '}) described above?
> 
> Would it be reasonable to change trimSpaces so that spaces within
> element attributes would be normalized to a single space, and others
> would be removed? I'm not sure how aware the parser is of the
> surrounding document structure.

The parser is completely unaware. As far as it is concerned, it is just
template text. Parsing the template text it is likely impossible since
correct parsing depends on evaluating the entire page.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-29 Thread Mark Thomas
On 29/05/17 09:09, David Kavanagh wrote:
> On 26 May 2017 at 22:33, Christopher Schultz 
> wrote:
> 
> Mark,
> 
> On 5/26/17 6:59 AM, Mark Thomas wrote:



 This is a potential use case for a recently closed (as WONTFIX)
 enhancement request:

 https://bz.apache.org/bugzilla/show_bug.cgi?id=45931

 Whether this use case is sufficient to justify re-opening that
 enhancement request, reviewing the patch and updating it for 9.0.x
 is TBD. How realistic is it for you to apply the fix (using ${'
 '}) described above?
> 
> Would it be reasonable to change trimSpaces so that spaces within
> element attributes would be normalized to a single space, and others
> would be removed? I'm not sure how aware the parser is of the
> surrounding document structure.
> 
> -chris



> Hey guys,
> 
> Thanks again for the help. For the Tomcat setup we currently have, the
> first link sent my Mark is a good fix for us.
> The other option Mark posted that would require modifying the .jsp files is
> unfortunately not realistic because we currently use thousands of .jsps.
> The possible fix that Christopher suggested in the last message would be
> the perfect solution.

BZ 45931 it is then. Please re-open that enhancement request and link to
this thread as the use case that justifies it. If you wanted to take a
look at porting the patch as well, that would be great.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-29 Thread David Kavanagh
On 26 May 2017 at 22:33, Christopher Schultz 
wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Mark,
>
> On 5/26/17 6:59 AM, Mark Thomas wrote:
> > On 26/05/17 10:15, David Kavanagh wrote:
> >> Hey guys,
> >>
> >> Thanks for getting back to me. I didn't realise that the
> >> attachments would be stripped.> Here are the two files in full.
> >
> > That isn't enough for us to reproduce it. Those files refer to a
> > handful of other tag files and classes we don't have.
> >
> > However, I have been able to derive a simple test case from it:
> >
> > =start== This is a test
> > ==end===
> >
> > The output with trimSpaces enabled is:
> >
> > =start== This is a test
> > ==end===
> >
> > trimSpaces is behaving exactly as designed. It removes any blocks
> > of template text that consist solely of white space.
> >
> > What you have is: TemplateText [This is a test]
> >
> > Because the second template text is empty, it gets removed.
> >
> > The fix is:
> >
> > =start== This is a
> > test ==end===
> >
> > This is a potential use case for a recently closed (as WONTFIX)
> > enhancement request:
> >
> > https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
> >
> > Whether this use case is sufficient to justify re-opening that
> > enhancement request, reviewing the patch and updating it for 9.0.x
> > is TBD. How realistic is it for you to apply the fix (using ${'
> > '}) described above?
>
> Would it be reasonable to change trimSpaces so that spaces within
> element attributes would be normalized to a single space, and others
> would be removed? I'm not sure how aware the parser is of the
> surrounding document structure.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlkokS8ACgkQHPApP6U8
> pFiW1A/+LnfMx+8SfU0TkGuhfxiKxh4kfdX+Hn4XNjJbcyAqTuPnwBD3D1kfXB6r
> QajDBPlEj9vKQgRZhdEuYpj/fMRxqxrdcwMR0ImjWhb4dm7q6ZxsDnWdWqzI3GF+
> ltYQ4Oql+NmCLkXMxZOF6JMUVJGWcj+wQnCuwWp5UvRzFhZTzevcz9H+35TPPa3z
> t+oX2ZjnAPXXVI+C8fnJ5qrdm6Ovj853BzQteR40vB6zwk8CDkyWhN98XEBz1DrD
> QMQTXe0VHa6B0cgrrNLna6K3S5FwolnQJS6xA2AKHMR8ugoAukBGJjBHntAo9NAH
> XvR+5Wxx/Iecc/9Cw/YuKgFzExEKQvU7Nj9EhuUrTIDKVGYMEG8rg2iEkRtqjd8T
> sQptiIt/kHoRSsatfSP1RzqhTVsbOJrATEQdoas5Tzn0rSKwXZkGPe7iHH/hHAlI
> EREd25F6zHHKJL6Vugw7UidRtqIg8htg2EwhgDstx/gw334L9xB//KnrMWM+ErDf
> gZkEPrE2tXzeu7hkDvpWVxERN9mMx6UT7uEUgG7csTBdKPh2snBBhJzSsKX2GyS6
> /OPXwzfFdD526rI5ZgzSzGbuC4Z1TAHjtBBnLWsstIjZtIRq+SKFGl15gfNxj0PQ
> KYc9uvoduFfUspT7eRaEk1DbkUBidA/sfhmPMgove3XVq+u5/SM=
> =gYLg
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Hey guys,

Thanks again for the help. For the Tomcat setup we currently have, the
first link sent my Mark is a good fix for us.
The other option Mark posted that would require modifying the .jsp files is
unfortunately not realistic because we currently use thousands of .jsps.
The possible fix that Christopher suggested in the last message would be
the perfect solution.

Kind Regards

David


Re: trimSpaces removing whitespace from html

2017-05-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 5/26/17 6:59 AM, Mark Thomas wrote:
> On 26/05/17 10:15, David Kavanagh wrote:
>> Hey guys,
>> 
>> Thanks for getting back to me. I didn't realise that the
>> attachments would be stripped.> Here are the two files in full.
> 
> That isn't enough for us to reproduce it. Those files refer to a
> handful of other tag files and classes we don't have.
> 
> However, I have been able to derive a simple test case from it:
> 
> =start== This is a test 
> ==end===
> 
> The output with trimSpaces enabled is:
> 
> =start== This is a test 
> ==end===
> 
> trimSpaces is behaving exactly as designed. It removes any blocks
> of template text that consist solely of white space.
> 
> What you have is: TemplateText [This is a test]
> 
> Because the second template text is empty, it gets removed.
> 
> The fix is:
> 
> =start== This is a
> test ==end===
> 
> This is a potential use case for a recently closed (as WONTFIX) 
> enhancement request:
> 
> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
> 
> Whether this use case is sufficient to justify re-opening that 
> enhancement request, reviewing the patch and updating it for 9.0.x
> is TBD. How realistic is it for you to apply the fix (using ${'
> '}) described above?

Would it be reasonable to change trimSpaces so that spaces within
element attributes would be normalized to a single space, and others
would be removed? I'm not sure how aware the parser is of the
surrounding document structure.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlkokS8ACgkQHPApP6U8
pFiW1A/+LnfMx+8SfU0TkGuhfxiKxh4kfdX+Hn4XNjJbcyAqTuPnwBD3D1kfXB6r
QajDBPlEj9vKQgRZhdEuYpj/fMRxqxrdcwMR0ImjWhb4dm7q6ZxsDnWdWqzI3GF+
ltYQ4Oql+NmCLkXMxZOF6JMUVJGWcj+wQnCuwWp5UvRzFhZTzevcz9H+35TPPa3z
t+oX2ZjnAPXXVI+C8fnJ5qrdm6Ovj853BzQteR40vB6zwk8CDkyWhN98XEBz1DrD
QMQTXe0VHa6B0cgrrNLna6K3S5FwolnQJS6xA2AKHMR8ugoAukBGJjBHntAo9NAH
XvR+5Wxx/Iecc/9Cw/YuKgFzExEKQvU7Nj9EhuUrTIDKVGYMEG8rg2iEkRtqjd8T
sQptiIt/kHoRSsatfSP1RzqhTVsbOJrATEQdoas5Tzn0rSKwXZkGPe7iHH/hHAlI
EREd25F6zHHKJL6Vugw7UidRtqIg8htg2EwhgDstx/gw334L9xB//KnrMWM+ErDf
gZkEPrE2tXzeu7hkDvpWVxERN9mMx6UT7uEUgG7csTBdKPh2snBBhJzSsKX2GyS6
/OPXwzfFdD526rI5ZgzSzGbuC4Z1TAHjtBBnLWsstIjZtIRq+SKFGl15gfNxj0PQ
KYc9uvoduFfUspT7eRaEk1DbkUBidA/sfhmPMgove3XVq+u5/SM=
=gYLg
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-26 Thread David Kavanagh
I will need to confirm with some people if that is a realistic fix for us
and i will let you know.

Thanks

On 26 May 2017 at 13:05, David Kavanagh  wrote:

> Thanks Mark,
>
> I will try that out and let you know if it sorts our issue.
>
> Much appreciated
>
> On 26 May 2017 at 12:59, Mark Thomas  wrote:
>
>> On 26/05/17 10:15, David Kavanagh wrote:
>> > Hey guys,
>> >
>> > Thanks for getting back to me. I didn't realise that the attachments
>> would
>> > be stripped.>
>> > Here are the two files in full.
>>
>> That isn't enough for us to reproduce it. Those files refer to a handful
>> of other tag files and classes we don't have.
>>
>> However, I have been able to derive a simple test case from it:
>>
>> =start==
>> This is a test
>> ==end===
>>
>> The output with trimSpaces enabled is:
>>
>> =start==
>> This is a test
>> ==end===
>>
>> trimSpaces is behaving exactly as designed. It removes any blocks of
>> template text that consist solely of white space.
>>
>> What you have is:
>> TemplateText [This is a test]
>>
>> Because the second template text is empty, it gets removed.
>>
>> The fix is:
>>
>> =start==
>> This is a test
>> ==end===
>>
>> This is a potential use case for a recently closed (as WONTFIX)
>> enhancement request:
>>
>> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
>>
>> Whether this use case is sufficient to justify re-opening that
>> enhancement request, reviewing the patch and updating it for 9.0.x is
>> TBD. How realistic is it for you to apply the fix (using ${' '})
>> described above?
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


Re: trimSpaces removing whitespace from html

2017-05-26 Thread David Kavanagh
Thanks Mark,

I will try that out and let you know if it sorts our issue.

Much appreciated

On 26 May 2017 at 12:59, Mark Thomas  wrote:

> On 26/05/17 10:15, David Kavanagh wrote:
> > Hey guys,
> >
> > Thanks for getting back to me. I didn't realise that the attachments
> would
> > be stripped.>
> > Here are the two files in full.
>
> That isn't enough for us to reproduce it. Those files refer to a handful
> of other tag files and classes we don't have.
>
> However, I have been able to derive a simple test case from it:
>
> =start==
> This is a test
> ==end===
>
> The output with trimSpaces enabled is:
>
> =start==
> This is a test
> ==end===
>
> trimSpaces is behaving exactly as designed. It removes any blocks of
> template text that consist solely of white space.
>
> What you have is:
> TemplateText [This is a test]
>
> Because the second template text is empty, it gets removed.
>
> The fix is:
>
> =start==
> This is a test
> ==end===
>
> This is a potential use case for a recently closed (as WONTFIX)
> enhancement request:
>
> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
>
> Whether this use case is sufficient to justify re-opening that
> enhancement request, reviewing the patch and updating it for 9.0.x is
> TBD. How realistic is it for you to apply the fix (using ${' '})
> described above?
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: trimSpaces removing whitespace from html

2017-05-26 Thread Mark Thomas
On 26/05/17 10:15, David Kavanagh wrote:
> Hey guys,
> 
> Thanks for getting back to me. I didn't realise that the attachments would
> be stripped.>
> Here are the two files in full.

That isn't enough for us to reproduce it. Those files refer to a handful
of other tag files and classes we don't have.

However, I have been able to derive a simple test case from it:

=start==
This is a test
==end===

The output with trimSpaces enabled is:

=start==
This is a test
==end===

trimSpaces is behaving exactly as designed. It removes any blocks of
template text that consist solely of white space.

What you have is:
TemplateText [This is a test]

Because the second template text is empty, it gets removed.

The fix is:

=start==
This is a test
==end===

This is a potential use case for a recently closed (as WONTFIX)
enhancement request:

https://bz.apache.org/bugzilla/show_bug.cgi?id=45931

Whether this use case is sufficient to justify re-opening that
enhancement request, reviewing the patch and updating it for 9.0.x is
TBD. How realistic is it for you to apply the fix (using ${' '})
described above?

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-26 Thread David Kavanagh
Hey guys,

Thanks for getting back to me. I didn't realise that the attachments would
be stripped.

Here are the two files in full.

The first is the imageTopWrapper.js

<%@taglib prefix="hint" tagdir="/WEB-INF/tags/vhosts/marfeel/tags/hint" %>
<%@ page import="com.marfeel.dali.tags.SummaryTagStrategy" %>




















And here is the second file, the tag file artileBody.tag




<%--
  ~ Copyright (c) 2013 by Marfeel Solutions (http://www.marfeel.com)
  ~ All Rights Reserved.
  ~
  ~ NOTICE:  All information contained herein is, and remains
  ~ the property of Marfeel Solutions S.L and its suppliers,
  ~ if any.  The intellectual and technical concepts contained
  ~ herein are proprietary to Marfeel Solutions S.L and its
  ~ suppliers and are protected by trade secret or copyright law.
  ~ Dissemination of this information or reproduction of this material
  ~ is strictly forbidden unless prior written permission is obtained
  ~ from Marfeel Solutions SL.
  --%>

<%@attribute name="alwaysImage" required="false" type="java.lang.Boolean" %>
<%@attribute name="forceBigImage" required="false" type="java.lang.Boolean"
%>
<%@attribute name="mediaSelectorStrategy" required="false"
type="java.lang.String"%>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core; %>
<%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali; %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions; %>
<%@taglib prefix="hint" tagdir="/WEB-INF/tags/vhosts/marfeel/tags/hint" %>
<%@taglib prefix="ui" tagdir="/WEB-INF/tags/vhosts/marfeel/tags/ui" %>



















































data-mrf-transitioner="${transitioner}"
 data-mrf-virtualpageid="${virtualPageId}"
 class="${articleClass} ${imageClassName} ${pocketClassName}">

















Thanks again for the help. Its really appreciated.

Kind Regards

David

On 24 May 2017 at 16:18, Christopher Schultz 
wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> David,
>
> Your attachments were stripped from the list. Can you put the text
> directly into your post?
>
> Thanks,
> - -chris
>
> On 5/24/17 6:29 AM, David Kavanagh wrote:
> > Hi Mark,
> >
> > Apologies for the delay. I have the files that should reproduce
> > the error for you. The imageTopWrapper.jsp loads the
> > articleBody.tag. Then inside the articleBody.tag file the
> > following section loads class names into the class attributes.
> >
> > http://section.name>}${fn:length(item.uri) == 0 ? item.id
> >  : item.detailItem.id
> > }" data-mrf-section="${section.name
> > }" data-mrf-section-title="${section.title}"
> > data-mrf-sectionId="${linkedItem == null ? section.name
> >  : 'articleLink'}"
> > data-mrf-extracted="${item.isExtracted()}"
> > data-mrf-uri="${item.uri}" data-mrf-layout="${layout}#${position}"
> > data-mrf-headline="${headline}"
> > data-shortcut="navigationLevel:open:details" data-mrf-transitioner="${transitioner}"
> > data-mrf-virtualpageid="${virtualPageId}"
> > class="${articleClass}${imageClassName}${pocketClassName}">
> >
> > This is the correct output when the trimSpaces flag is not
> > enabled.
> >
> > class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> > mrf-author mrf-m mrf-image ">
> >
> >
> > This is the output after it is enabled
> >
> > class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> > mrf-author mrf-mmrf-image">
> >
> >
> > I have attached the two necessary files. Hopefully this can
> > reproduce the error for you
> >
> > Thanks
> >
> >
> >
> > -
> >
> >
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJZJZZMAAoJEBzwKT+lPKRYXpYP/3ZS4M7eaZ+/13kY09RWe1cP
> m9THOTZxZNOuv/8FV5Zysdy1c2c1FWAyyS/JfIt0k2j6mDiEYOi9zjR1Bcrue05Z
> sI1UHUeFK4t+uPEQiXmz0NPrH+1Wj/d3QqbZrdhmZ6EJBFf5vZTWeft6ynX1Gjpc
> EV20DMMYjblsStwF1NTflJxbWBXkvYD8Kj8CzKpfExZF73AZdpxcScSjXsky3+4V
> W2Gm2LkQ9tKBa4Zzz8p0DCt1iHCMb8qUVHWd6zoLW10NcScwTHhd/uSj1ZVqMNv5
> P0K0Vvw8tSZ5/TuVnZZeSZgIlhsNwX2JAoIjiqrid0bn0IEM54k5ULZnq7+fBoZP
> eeAMybADTZhgjUqOjeKarV5GK3uGTkGble0LVq5NFETTwd3eZIwTij1Xd7YHhPPq
> uK44R9GzhWwI+k7CNUMU3l4SXDLBaFklCHevfw+ibpW1tP3hvXMLOiTD23gG9xHS
> pn7cjLKps7ovR0WeYFLwLtzFSW6GjlUdU1nvRqIeg0+RpcVI/BZvOvaneuKGKgan
> MLUayvdNwhY3b29d7i0e2zV8hVAD7LSTVDlMeLjOfvftuxgPXBrUagQktHjr/6tA
> 

Re: trimSpaces removing whitespace from html

2017-05-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

David,

Your attachments were stripped from the list. Can you put the text
directly into your post?

Thanks,
- -chris

On 5/24/17 6:29 AM, David Kavanagh wrote:
> Hi Mark,
> 
> Apologies for the delay. I have the files that should reproduce
> the error for you. The imageTopWrapper.jsp loads the
> articleBody.tag. Then inside the articleBody.tag file the
> following section loads class names into the class attributes.
> 
> http://section.name>}${fn:length(item.uri) == 0 ? item.id 
>  : item.detailItem.id
> }" data-mrf-section="${section.name
> }" data-mrf-section-title="${section.title}" 
> data-mrf-sectionId="${linkedItem == null ? section.name 
>  : 'articleLink'}" 
> data-mrf-extracted="${item.isExtracted()}" 
> data-mrf-uri="${item.uri}" data-mrf-layout="${layout}#${position}" 
> data-mrf-headline="${headline}" 
> data-shortcut="navigationLevel:open:details" data-mrf-transitioner="${transitioner}" 
> data-mrf-virtualpageid="${virtualPageId}" 
> class="${articleClass}${imageClassName}${pocketClassName}">
> 
> This is the correct output when the trimSpaces flag is not
> enabled.
> 
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-m mrf-image ">
> 
> 
> This is the output after it is enabled
> 
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-mmrf-image">
> 
> 
> I have attached the two necessary files. Hopefully this can
> reproduce the error for you
> 
> Thanks
> 
> 
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJZJZZMAAoJEBzwKT+lPKRYXpYP/3ZS4M7eaZ+/13kY09RWe1cP
m9THOTZxZNOuv/8FV5Zysdy1c2c1FWAyyS/JfIt0k2j6mDiEYOi9zjR1Bcrue05Z
sI1UHUeFK4t+uPEQiXmz0NPrH+1Wj/d3QqbZrdhmZ6EJBFf5vZTWeft6ynX1Gjpc
EV20DMMYjblsStwF1NTflJxbWBXkvYD8Kj8CzKpfExZF73AZdpxcScSjXsky3+4V
W2Gm2LkQ9tKBa4Zzz8p0DCt1iHCMb8qUVHWd6zoLW10NcScwTHhd/uSj1ZVqMNv5
P0K0Vvw8tSZ5/TuVnZZeSZgIlhsNwX2JAoIjiqrid0bn0IEM54k5ULZnq7+fBoZP
eeAMybADTZhgjUqOjeKarV5GK3uGTkGble0LVq5NFETTwd3eZIwTij1Xd7YHhPPq
uK44R9GzhWwI+k7CNUMU3l4SXDLBaFklCHevfw+ibpW1tP3hvXMLOiTD23gG9xHS
pn7cjLKps7ovR0WeYFLwLtzFSW6GjlUdU1nvRqIeg0+RpcVI/BZvOvaneuKGKgan
MLUayvdNwhY3b29d7i0e2zV8hVAD7LSTVDlMeLjOfvftuxgPXBrUagQktHjr/6tA
l11RjI86F0TbWX/ZSFvrKfpBkp7OpIsC/ayuovm4bWosCIIK8HzUc3GQUc1G34yD
IyerNligTd2KezQytipB
=uh7o
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-24 Thread David Kavanagh
Hi Mark,

Apologies for the delay. I have the files that should reproduce the error
for you.
The imageTopWrapper.jsp loads the articleBody.tag. Then inside the
articleBody.tag file the following
section loads class names into the class attributes.

data-mrf-transitioner="${transitioner}"
 data-mrf-virtualpageid="${virtualPageId}"
 class="${articleClass} ${imageClassName} ${pocketClassName}">

This is the correct output when the trimSpaces flag is not enabled.

class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author
mrf-m mrf-image ">


This is the output after it is enabled

class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author
mrf-mmrf-image">


I have attached the two necessary files.
Hopefully this can reproduce the error for you

Thanks

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Re: trimSpaces removing whitespace from html

2017-05-17 Thread Mark Thomas

On 15/05/2017 10:29, David Kavanagh wrote:

Ok cool, hopefully that will reproduce so you can see for yourself.
Thanks!


I've done the best I can to reproduce this without the access to the 
commerical tag library you appear to be using without success.


I've also checked the trimSpaces implementation and I can't see how an 
attribute value could be corrupted.


At this point I'm inclined to think this is not a Tomcat problem. If you 
can provide a simple test case (e.g JSP and tag file) that can be 
dropped into Tomcat to demonstrate this problem then I'd be happy to 
look at this further.


Mark





On 15 May 2017 at 10:39, Mark Thomas  wrote:


On 12/05/17 17:08, David Kavanagh wrote:

Yes, this is one of the .jsp files. I don't know how useful this is.


Hopefully this will reproduce this. Looking at this is on my TODO list
while I'm at ApacheCon.


Has anyone heard of a similar issue using trimSpaces before, or do you
think this might be something to do with the particular files being used?


This isn't anything I recall seeing before. The parsing is all handled
by the JRE. While historically the XML parsing provided by the JRE was
fairly buggy, these days it is much better. One thing on my TODO list is
to check the XML specs to make sure that any required escaping is not
missing or something along those lines.





Thanks

<%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali; %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core; %>

<%@page pageEncoding="UTF-8" %>




On 11 May 2017 at 18:35, Mark Thomas  wrote:


On 11 May 2017 15:34:32 BST, David Kavanagh  wrote:


Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher

Schultz:

So, removing the trailing space in the "class" attribute's value?


That too - but have a look at:

mrf-mmrf-image

it was before / should be:

mrf-m mrf-image

there are missing whitespaces in the actual class attributes content.

Torsten


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




Can you provide the simplest JSP that reproduces this issue?

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-15 Thread David Kavanagh
Ok cool, hopefully that will reproduce so you can see for yourself.
Thanks!

On 15 May 2017 at 10:39, Mark Thomas  wrote:

> On 12/05/17 17:08, David Kavanagh wrote:
> > Yes, this is one of the .jsp files. I don't know how useful this is.
>
> Hopefully this will reproduce this. Looking at this is on my TODO list
> while I'm at ApacheCon.
>
> > Has anyone heard of a similar issue using trimSpaces before, or do you
> > think this might be something to do with the particular files being used?
>
> This isn't anything I recall seeing before. The parsing is all handled
> by the JRE. While historically the XML parsing provided by the JRE was
> fairly buggy, these days it is much better. One thing on my TODO list is
> to check the XML specs to make sure that any required escaping is not
> missing or something along those lines.
>
>
>
> >
> > Thanks
> >
> > <%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali; %>
> > <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core; %>
> >
> > <%@page pageEncoding="UTF-8" %>
> >
> > 
> >  >   imageClass="l"
> >   size="xs"
> >   layout="${layout}"
> >   defaultLayoutName="author"
> >   item="${currentItem}"
> >   articleTemplate="articleTemplates/author.jsp"
> >   extended="false"/>
> >
> > On 11 May 2017 at 18:35, Mark Thomas  wrote:
> >
> >> On 11 May 2017 15:34:32 BST, David Kavanagh  >
> >> wrote:
> >>> Yes, the problem happens in the class attribute string.
> >>> They are some examples but it happened throughout the files in many
> >>> cases.
> >>>
> >>> I am using .jsp files
> >>>
> >>> Also, in the second example that i gave, you can see that mrf-video was
> >>> removed as well as mrf-m and mrf-image being joined.
> >>> This was the strangest one to me, and it only happened once in the
> >>> file.
> >>>
> >>>
> >>> On 11 May 2017 at 15:33, Torsten Krah  wrote:
> >>>
>  Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher
> >>> Schultz:
> > So, removing the trailing space in the "class" attribute's value?
> 
>  That too - but have a look at:
> 
>  mrf-mmrf-image
> 
>  it was before / should be:
> 
>  mrf-m mrf-image
> 
>  there are missing whitespaces in the actual class attributes content.
> 
>  Torsten
> 
> 
>  -
>  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> >>
> >> Can you provide the simplest JSP that reproduces this issue?
> >>
> >> Mark
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: trimSpaces removing whitespace from html

2017-05-15 Thread Mark Thomas
On 12/05/17 17:08, David Kavanagh wrote:
> Yes, this is one of the .jsp files. I don't know how useful this is.

Hopefully this will reproduce this. Looking at this is on my TODO list
while I'm at ApacheCon.

> Has anyone heard of a similar issue using trimSpaces before, or do you
> think this might be something to do with the particular files being used?

This isn't anything I recall seeing before. The parsing is all handled
by the JRE. While historically the XML parsing provided by the JRE was
fairly buggy, these days it is much better. One thing on my TODO list is
to check the XML specs to make sure that any required escaping is not
missing or something along those lines.



> 
> Thanks
> 
> <%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali; %>
> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core; %>
> 
> <%@page pageEncoding="UTF-8" %>
> 
> 
>imageClass="l"
>   size="xs"
>   layout="${layout}"
>   defaultLayoutName="author"
>   item="${currentItem}"
>   articleTemplate="articleTemplates/author.jsp"
>   extended="false"/>
> 
> On 11 May 2017 at 18:35, Mark Thomas  wrote:
> 
>> On 11 May 2017 15:34:32 BST, David Kavanagh 
>> wrote:
>>> Yes, the problem happens in the class attribute string.
>>> They are some examples but it happened throughout the files in many
>>> cases.
>>>
>>> I am using .jsp files
>>>
>>> Also, in the second example that i gave, you can see that mrf-video was
>>> removed as well as mrf-m and mrf-image being joined.
>>> This was the strangest one to me, and it only happened once in the
>>> file.
>>>
>>>
>>> On 11 May 2017 at 15:33, Torsten Krah  wrote:
>>>
 Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher
>>> Schultz:
> So, removing the trailing space in the "class" attribute's value?

 That too - but have a look at:

 mrf-mmrf-image

 it was before / should be:

 mrf-m mrf-image

 there are missing whitespaces in the actual class attributes content.

 Torsten


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


>>
>> Can you provide the simplest JSP that reproduces this issue?
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-12 Thread David Kavanagh
Yes, this is one of the .jsp files. I don't know how useful this is.
Has anyone heard of a similar issue using trimSpaces before, or do you
think this might be something to do with the particular files being used?

Thanks

<%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali; %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core; %>

<%@page pageEncoding="UTF-8" %>




On 11 May 2017 at 18:35, Mark Thomas  wrote:

> On 11 May 2017 15:34:32 BST, David Kavanagh 
> wrote:
> >Yes, the problem happens in the class attribute string.
> >They are some examples but it happened throughout the files in many
> >cases.
> >
> >I am using .jsp files
> >
> >Also, in the second example that i gave, you can see that mrf-video was
> >removed as well as mrf-m and mrf-image being joined.
> >This was the strangest one to me, and it only happened once in the
> >file.
> >
> >
> >On 11 May 2017 at 15:33, Torsten Krah  wrote:
> >
> >> Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher
> >Schultz:
> >> > So, removing the trailing space in the "class" attribute's value?
> >>
> >> That too - but have a look at:
> >>
> >> mrf-mmrf-image
> >>
> >> it was before / should be:
> >>
> >> mrf-m mrf-image
> >>
> >> there are missing whitespaces in the actual class attributes content.
> >>
> >> Torsten
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
>
> Can you provide the simplest JSP that reproduces this issue?
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: trimSpaces removing whitespace from html

2017-05-11 Thread Mark Thomas
On 11 May 2017 15:34:32 BST, David Kavanagh  wrote:
>Yes, the problem happens in the class attribute string.
>They are some examples but it happened throughout the files in many
>cases.
>
>I am using .jsp files
>
>Also, in the second example that i gave, you can see that mrf-video was
>removed as well as mrf-m and mrf-image being joined.
>This was the strangest one to me, and it only happened once in the
>file.
>
>
>On 11 May 2017 at 15:33, Torsten Krah  wrote:
>
>> Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher
>Schultz:
>> > So, removing the trailing space in the "class" attribute's value?
>>
>> That too - but have a look at:
>>
>> mrf-mmrf-image
>>
>> it was before / should be:
>>
>> mrf-m mrf-image
>>
>> there are missing whitespaces in the actual class attributes content.
>>
>> Torsten
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>

Can you provide the simplest JSP that reproduces this issue?

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-11 Thread David Kavanagh
Yes, the problem happens in the class attribute string.
They are some examples but it happened throughout the files in many cases.

I am using .jsp files

Also, in the second example that i gave, you can see that mrf-video was
removed as well as mrf-m and mrf-image being joined.
This was the strangest one to me, and it only happened once in the file.


On 11 May 2017 at 15:33, Torsten Krah  wrote:

> Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher Schultz:
> > So, removing the trailing space in the "class" attribute's value?
>
> That too - but have a look at:
>
> mrf-mmrf-image
>
> it was before / should be:
>
> mrf-m mrf-image
>
> there are missing whitespaces in the actual class attributes content.
>
> Torsten
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: trimSpaces removing whitespace from html

2017-05-11 Thread Torsten Krah
Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher Schultz:
> So, removing the trailing space in the "class" attribute's value?

That too - but have a look at:

mrf-mmrf-image

it was before / should be:

mrf-m mrf-image

there are missing whitespaces in the actual class attributes content.

Torsten


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256



David,

On 5/11/17 3:27 AM, David Kavanagh wrote:
> Thanks for the quick reply.
> 
> This is the code that i added to the web.xml file to activate
trimSpaces:
> 
>  trimSpaces 
> true 
> 
> This is the HTML code:
> 
> 1. Before
> 
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-m mrf-image ">
> 
> 
> 1.After
> 
> 
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-mmrf-image">

So, removing the trailing space in the "class" attribute's value?

> 2.Before
> 
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-video mrf-m mrf-image ">
> 
> 
> 2.After
> 
> 
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-mmrf-image">

This is the same thing, right?

> 3.Before
> 
> 
> 
> 
> 3.After
> 
> 

And here as well?

> There are many more incidents of the same thing happening.

Are you using .jsp or .jspx?

If .jspx, then you are subject to the XML spec's rules for normalizing
element attribute values[1]. Specifically, this part:

"
[T]he XML processor MUST further process the normalized attribute value
by discarding any leading and trailing space (#x20) characters[.]
"

- -chris

[1] https://www.w3.org/TR/REC-xml/#AVNormalize


-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlkUZewACgkQHPApP6U8
pFgaUw/9HQYmHdTsQvt9UppCrRbp+2MAJ0CbyC9VdEvtjscMJ7e0McZCKEeBVRsv
XBIAjO4DH+fbQhSXojBwOdV6uaNCqBbUCrvnx6INcDTCSa0LG81DgZvjSa7gsY/b
Nv4OHPfFqVX38UPj6hsR+/PH8ZZ4rI7CUMRwrR3Dy8k//qdUWXY+TrOaTVx/OaIN
tqD5sKQUjT+TapyF0iSfI/dpP1RSfz6pJvVIQQAl42+UkzHunti0pcEWqwsj6+vM
Ubq9vA+9PUN6dOtPRM4WpBNYWgpNfRLLWvF0zgmy1aNBUJewZc4EVL69yWk67PKj
UymWV/oEhPPnHq2xpPG852D21su28aSZ3IRUlIYWioAzCZ8KZAZrSwEezIJ+3bzm
XNNQD45HO7QDRhD+msKTaR8FXuEnrRvXZ/wpro+mb0nNa9rBPswKPEPqh12WL/nH
CzGEwi4tyikz8sH5M/huMpw9kbn9+wNsMKbqNKOQQgBPA0/RwHFi7M5J+BLYqpwx
HlpdRpFy+HOdnDT7qhdm4q27iRszbf78+O2nTKVXFAv37BO08tSh+KG3rrkZecyL
QEIFNBEnQYt+S+7PmL0QClGSnYU9Thli+YAeydvnkcGCfLJdXT4LcVszTucTyaB/
YgZ/h3ubiWqukWL1H+4xmzNFwlaHVR86XA59kYf6B3xiAkQyblI=
=tWgw
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: trimSpaces removing whitespace from html

2017-05-11 Thread David Kavanagh
Thanks for the quick reply.

This is the code that i added to the web.xml file to activate trimSpaces:


trimSpaces
true


This is the HTML code:

1. Before

class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author
mrf-m mrf-image ">


1.After


class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author
mrf-mmrf-image">


2.Before

class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author
mrf-video mrf-m mrf-image ">


2.After


class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author
mrf-mmrf-image">


3.Before




3.After




There are many more incidents of the same thing happening.


Thanks


On 10 May 2017 at 20:13, Mark Thomas  wrote:

> On 10/05/17 17:17, David Kavanagh wrote:
> > Hey,
> >
> > I am wondering if anyone has come across this issue, and hopefully a way
> > to fix it.
> > When i enable the trimSpaces configuration option it removes the
> > whitespace but also
> > removes some whitespace from particular areas of the html. In my case,
> > it removes white space between some of the classes in a class=" class1
> > class2 class3" string. In one case, the first example, it actually
> > removes text as well. I am running Tomcat version 8.0.15.
> >
> > Here are some examples:
>
> The in-line images are removed by the list software.
>
> If you can include the example source and resulting HTML snippets
> in-line, that would work better.
>
> Mark
>
>
>
> > Any advice on this would be greatly appreciated.
> >
> > Kind Regards
> >
> > David
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: trimSpaces removing whitespace from html

2017-05-10 Thread Mark Thomas
On 10/05/17 17:17, David Kavanagh wrote:
> Hey,
> 
> I am wondering if anyone has come across this issue, and hopefully a way
> to fix it.
> When i enable the trimSpaces configuration option it removes the
> whitespace but also 
> removes some whitespace from particular areas of the html. In my case,
> it removes white space between some of the classes in a class=" class1
> class2 class3" string. In one case, the first example, it actually
> removes text as well. I am running Tomcat version 8.0.15.
> 
> Here are some examples:

The in-line images are removed by the list software.

If you can include the example source and resulting HTML snippets
in-line, that would work better.

Mark



> Any advice on this would be greatly appreciated.
> 
> Kind Regards
> 
> David
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



trimSpaces removing whitespace from html

2017-05-10 Thread David Kavanagh
Hey,

I am wondering if anyone has come across this issue, and hopefully a way to
fix it.
When i enable the trimSpaces configuration option it removes the whitespace
but also
removes some whitespace from particular areas of the html. In my case, it
removes white space between some of the classes in a class=" class1 class2
class3" string. In one case, the first example, it actually removes text as
well. I am running Tomcat version 8.0.15.

Here are some examples:

1. Before
[image: Inline images 1]
1. After
[image: Inline images 2]

2. Before
[image: Inline images 3]
2. After
[image: Inline images 5]

3. Before
[image: Inline images 6]

3. After
[image: Inline images 7]

Any advice on this would be greatly appreciated.

Kind Regards

David