[ 
https://issues.apache.org/jira/browse/MTOMCAT-321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hicham Mouloudi updated MTOMCAT-321:
------------------------------------
    Description: 
Hello,

We have a Spring based web application project where we have about 350 custom 
tags under /WEB-INF/tags/. When inspecting the source page html, we can see a 
lot of generated white spaces between html elements (around 5000 back to lines 
added). 

!image-2020-11-27-14-17-23-102.png|width=573,height=386!

We already have done the configuration in the jsp level as follow 
{code:java}
<jsp-config>
 <jsp-property-group> 
<url-pattern>*.jsp</url-pattern> 
<!-- Disable JSP scriptlets and expressions -->
 <scripting-invalid>true</scripting-invalid> <
!-- Remove additional whitespace due to JSP directives --> 
<trim-directive-whitespaces>true</trim-directive-whitespaces>
 </jsp-property-group> 
</jsp-config>
{code}
And we also declared the <%@ page trimDirectiveWhitespaces="true" %> inside our 
jsp  custom pages.

 

We want to trim white space in all custom tags, so we've added the directive 
<%@ tag trimDirectiveWhitespaces="true" %>. And  we had some blocking issues as 
this directive on tag level trim inner html element spaces !

For example a radio button that have checked directive inside it  will be like :

<input type="radio" value="ex" checkeddata-track-event="somevalue" ../>

!image-2020-11-27-14-08-01-135.png|width=508,height=74!

 

You can notice that the checked is concatenated with the field data-track-event.

 

We also tried the following configuration
{code:java}
<jsp-property-group> 
<url-pattern>*.tag</url-pattern> 
<trim-directive-whitespaces>true</trim-directive-whitespaces> 
</jsp-property-group>
{code}
But this is blocked by the JspConfig class.

!image-2020-11-27-14-03-02-603.png|width=977,height=292!

 

So adding <%@ tag trimDirectiveWhitespaces="true" %>  to prevent those 
generated white space in all our custom tags will have an expected error in our 
production code, as it will required a lot of test and analysis. And with this 
issue of removing inner html element white space we are afraid to break all 
existing front end functionalities, like checkout pages, user registration, 
order creations ... 

 

Can you please help on this issue by providing us with a fix or a workaround ?

tomcat.version  : 7.0.82.A.RELEAS

spring.version :  4.3.17.RELEASE7

java.version : 1.8

!image-2020-11-27-14-15-31-718.png|width=584,height=179!

Best Regards

  was:
Hello,

We have a Spring based web application project where we have about 350 custom 
tags under /WEB-INF/tags/. When inspecting the source page html, we can see a 
lot of generated white spaces between html elements (around 5000 back to lines 
added). 

!image-2020-11-27-14-17-23-102.png|width=573,height=386!

We already have done the configuration in the jsp level as follow 
{code:java}
<jsp-config>
 <jsp-property-group> 
<url-pattern>*.jsp</url-pattern> 
<!-- Disable JSP scriptlets and expressions -->
 <scripting-invalid>true</scripting-invalid> <
!-- Remove additional whitespace due to JSP directives --> 
<trim-directive-whitespaces>true</trim-directive-whitespaces>
 </jsp-property-group> 
</jsp-config>
{code}
And we also declared the <%@ page trimDirectiveWhitespaces="true" %> inside our 
jsp  custom pages.

 

We want to trim white space in all custom tags, so we need to add <%@ tag 
trimDirectiveWhitespaces="true" %> we had some blocking issues as this 
directive on tag level trim inner html element spaces 

For example a radio button that have checked directive inside will be like 

<input type="radio" value="ex" checkeddata-track-event="somevalue" ../>

!image-2020-11-27-14-08-01-135.png|width=508,height=74!

You can notice that the checked is concatenated with the field data-track-event.

 

We also tried the following configuration
{code:java}
<jsp-property-group> 
<url-pattern>*.tag</url-pattern> 
<trim-directive-whitespaces>true</trim-directive-whitespaces> 
</jsp-property-group>
{code}
But this is blocked by the JspConfig class.

!image-2020-11-27-14-03-02-603.png|width=977,height=292!

 

So adding <%@ tag trimDirectiveWhitespaces="true" %>  to prevent those 
generated white space in all our custom tags will have an expected error in our 
production code, as it will required a lot of test and analysis. And with this 
issue of removing inner html element white space we are afraid to break all 
existing front end functionalities, like checkout pages, user registration, 
order creations ... 

 

Can you please help on this issue by providing us with a fix or a workaround ?

tomcat.version  : 7.0.82.A.RELEAS

spring.version :  4.3.17.RELEASE7

java.version : 1.8

!image-2020-11-27-14-15-31-718.png|width=584,height=179!

Best Regards


> trimDirectiveWhitespaces does not apply for custom tags in Tomcat provided 
> jasper lib
> -------------------------------------------------------------------------------------
>
>                 Key: MTOMCAT-321
>                 URL: https://issues.apache.org/jira/browse/MTOMCAT-321
>             Project: Apache Tomcat Maven Plugin
>          Issue Type: Bug
>         Environment: tomcat.version  : 7.0.82.A.RELEASE
> spring.version :  4.3.17.RELEASE
> java.version :  1.8
>            Reporter: Hicham Mouloudi
>            Priority: Major
>         Attachments: image-2020-11-27-14-03-02-603.png, 
> image-2020-11-27-14-08-01-135.png, image-2020-11-27-14-15-31-718.png, 
> image-2020-11-27-14-17-23-102.png
>
>
> Hello,
> We have a Spring based web application project where we have about 350 custom 
> tags under /WEB-INF/tags/. When inspecting the source page html, we can see a 
> lot of generated white spaces between html elements (around 5000 back to 
> lines added). 
> !image-2020-11-27-14-17-23-102.png|width=573,height=386!
> We already have done the configuration in the jsp level as follow 
> {code:java}
> <jsp-config>
>  <jsp-property-group> 
> <url-pattern>*.jsp</url-pattern> 
> <!-- Disable JSP scriptlets and expressions -->
>  <scripting-invalid>true</scripting-invalid> <
> !-- Remove additional whitespace due to JSP directives --> 
> <trim-directive-whitespaces>true</trim-directive-whitespaces>
>  </jsp-property-group> 
> </jsp-config>
> {code}
> And we also declared the <%@ page trimDirectiveWhitespaces="true" %> inside 
> our jsp  custom pages.
>  
> We want to trim white space in all custom tags, so we've added the directive 
> <%@ tag trimDirectiveWhitespaces="true" %>. And  we had some blocking issues 
> as this directive on tag level trim inner html element spaces !
> For example a radio button that have checked directive inside it  will be 
> like :
> <input type="radio" value="ex" checkeddata-track-event="somevalue" ../>
> !image-2020-11-27-14-08-01-135.png|width=508,height=74!
>  
> You can notice that the checked is concatenated with the field 
> data-track-event.
>  
> We also tried the following configuration
> {code:java}
> <jsp-property-group> 
> <url-pattern>*.tag</url-pattern> 
> <trim-directive-whitespaces>true</trim-directive-whitespaces> 
> </jsp-property-group>
> {code}
> But this is blocked by the JspConfig class.
> !image-2020-11-27-14-03-02-603.png|width=977,height=292!
>  
> So adding <%@ tag trimDirectiveWhitespaces="true" %>  to prevent those 
> generated white space in all our custom tags will have an expected error in 
> our production code, as it will required a lot of test and analysis. And with 
> this issue of removing inner html element white space we are afraid to break 
> all existing front end functionalities, like checkout pages, user 
> registration, order creations ... 
>  
> Can you please help on this issue by providing us with a fix or a workaround ?
> tomcat.version  : 7.0.82.A.RELEAS
> spring.version :  4.3.17.RELEASE7
> java.version : 1.8
> !image-2020-11-27-14-15-31-718.png|width=584,height=179!
> Best Regards



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to