You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Milanez, Marcus" <Ma...@diebold.com> on 2008/05/09 16:04:17 UTC
trim-directive-whitespaces and .tag files
Hi,
I'm successfully using trim-directive-whitespaces in my web.xml file,
clearing unecessary white spaces from my pages. The only problem is that
.tag files content is not affected by this directive. Is there a way to
make it work? I've searched a lot for it and couldn't find anything...
I'm using the following directive at this moment:
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<trim-directive-whitespaces>true</trim-directive-whitespaces>
</jsp-property-group>
</jsp-config>
Any suggestion?
Thank you all!
Marcus Milanez
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RES: trim-directive-whitespaces and .tag files
Posted by "Milanez, Marcus" <Ma...@diebold.com>.
Thabks a lot for your effort!
-----Mensagem original-----
De: Hassan Schroeder [mailto:hassan.schroeder@gmail.com]
Enviada em: sexta-feira, 9 de maio de 2008 15:51
Para: Tomcat Users List
Assunto: Re: trim-directive-whitespaces and .tag files
On Fri, May 9, 2008 at 11:42 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> Which is slightly different, but got the directive working... Thus, I
> believe this is the most appropriate web-app descriptor, right?
sounds like :-) -- glad to hear it's working now!
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: trim-directive-whitespaces and .tag files
Posted by Hassan Schroeder <ha...@gmail.com>.
On Fri, May 9, 2008 at 11:42 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> Which is slightly different, but got the directive working... Thus, I
> believe this is the most appropriate web-app descriptor, right?
sounds like :-) -- glad to hear it's working now!
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: trim-directive-whitespaces and .tag files
Posted by Lucas Galfaso <lg...@gmail.com>.
Have you try converting your .tag files to .tagx files?
On Fri, May 9, 2008 at 11:45 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
>
> OK Hassan, thanks a lot! If I could get this directive working with .tag
> files I would appreciate a lot more, but if I couldn't find a way, I'll
> try your suggestion!
>
> Just a final questions: should it be working or not? I mean, ths
> specification for trim-directive-whitespaces says that it could not work
> in these cases?
>
> Thanks a lot for your time!
>
> Marcus Milanez
>
> -----Mensagem original-----
> De: Hassan Schroeder [mailto:hassan.schroeder@gmail.com]
> Enviada em: sexta-feira, 9 de maio de 2008 11:38
> Para: Tomcat Users List
> Assunto: Re: trim-directive-whitespaces and .tag files
>
> On Fri, May 9, 2008 at 7:28 AM, Milanez, Marcus
> <Ma...@diebold.com> wrote:
>
>> I think it won't be possible to trim white spaces from .tag files
>> uwing this directive then...
>
> If minimizing white space is critical for you, you might try something
> with the String taglib -- maybe wrap a string:squeeze around the whole
> tag body. Just a first-cup-of-coffee thought... :-)
>
> HTH,
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RES: trim-directive-whitespaces and .tag files
Posted by "Milanez, Marcus" <Ma...@diebold.com>.
Hassan,
Thanks a lot. It worked! I noticed we were using the following web-app
in DTD:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
Then I just replaced by
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
metadata-complete="false"
version="2.5">
Which is slightly different, but got the directive working... Thus, I
believe this is the most appropriate web-app descriptor, right?
Thanks a lot for all your support!
Marcus Milanez
-----Mensagem original-----
De: Hassan Schroeder [mailto:hassan.schroeder@gmail.com]
Enviada em: sexta-feira, 9 de maio de 2008 15:27
Para: Tomcat Users List
Assunto: Re: trim-directive-whitespaces and .tag files
On Fri, May 9, 2008 at 11:00 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> trimDirectiveWhitespaces directive simply doesn't work at all in
> Tomcat 6.. I've posted this question here some months ago..
Uh, I just tried it on both a JSP file (page directive) and tag file
using the tag directive, and both worked fine.
Are you sure you're using a 2.5 deployment descriptor?
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: trim-directive-whitespaces and .tag files
Posted by Hassan Schroeder <ha...@gmail.com>.
On Fri, May 9, 2008 at 11:00 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> trimDirectiveWhitespaces directive simply doesn't work at all in Tomcat
> 6.. I've posted this question here some months ago..
Uh, I just tried it on both a JSP file (page directive) and tag file using
the tag directive, and both worked fine.
Are you sure you're using a 2.5 deployment descriptor?
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RES: trim-directive-whitespaces and .tag files
Posted by "Milanez, Marcus" <Ma...@diebold.com>.
Oh,I'm sorry, I thought you were refeering errouneous withe space
trimming...
trimDirectiveWhitespaces directive simply doesn't work at all in Tomcat
6.. I've posted this question here some months ago..
-----Mensagem original-----
De: Hassan Schroeder [mailto:hassan.schroeder@gmail.com]
Enviada em: sexta-feira, 9 de maio de 2008 14:09
Para: Tomcat Users List
Assunto: Re: trim-directive-whitespaces and .tag files
On Fri, May 9, 2008 at 9:55 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> I've reard about this issues, but our tests confirmed that all JSPs
> and scripts are working well. We've also downloaded a filter that does
> just the same, but we've experimented some javascript problems...
Not sure what "issues" you're referring to :-)
I was just highlighting this:
tag file directive attribute trimDirectiveWhitespaces
:: meaning, you can put that in each tag file directly to achieve your
original goal.
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: trim-directive-whitespaces and .tag files
Posted by Hassan Schroeder <ha...@gmail.com>.
On Fri, May 9, 2008 at 9:55 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> I've reard about this issues, but our tests confirmed that all JSPs and
> scripts are working well. We've also downloaded a filter that does just
> the same, but we've experimented some javascript problems...
Not sure what "issues" you're referring to :-)
I was just highlighting this:
tag file directive attribute trimDirectiveWhitespaces
:: meaning, you can put that in each tag file directly to achieve your
original goal.
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RES: trim-directive-whitespaces and .tag files
Posted by "Milanez, Marcus" <Ma...@diebold.com>.
Hassan,
I've reard about this issues, but our tests confirmed that all JSPs and
scripts are working well. We've also downloaded a filter that does just
the same, but we've experimented some javascript problems...
Thanks!
Marcus Milanez
-----Mensagem original-----
De: Hassan Schroeder [mailto:hassan.schroeder@gmail.com]
Enviada em: sexta-feira, 9 de maio de 2008 12:10
Para: Tomcat Users List
Assunto: Re: trim-directive-whitespaces and .tag files
On Fri, May 9, 2008 at 7:45 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> Just a final questions: should it be working or not? I mean, ths
> specification for trim-directive-whitespaces says that it could not
> work in these cases?
Actually, the 2.1 spec says:
"As of JSP 2.1, it is possible to have extraneous whitespaces removed
from template text through element trim-directive-whitespaces of JSP
Property Groups (See Section JSP.3.3.8, "Removing whitespaces from
template text"), or the page and tag file directive attribute
trimDirectiveWhitespaces (See Section JSP.1.10.1, "The page Directive",
Section JSP.8.5.1, "The tag Directive")."
So looks like a little more experimentation is in order :-)
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: trim-directive-whitespaces and .tag files
Posted by Hassan Schroeder <ha...@gmail.com>.
On Fri, May 9, 2008 at 7:45 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> Just a final questions: should it be working or not? I mean, ths
> specification for trim-directive-whitespaces says that it could not work
> in these cases?
Actually, the 2.1 spec says:
"As of JSP 2.1, it is possible to have extraneous whitespaces removed from
template text through element trim-directive-whitespaces of JSP Property Groups
(See Section JSP.3.3.8, "Removing whitespaces from template text"), or the page
and tag file directive attribute trimDirectiveWhitespaces (See Section
JSP.1.10.1,
"The page Directive", Section JSP.8.5.1, "The tag Directive")."
So looks like a little more experimentation is in order :-)
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RES: trim-directive-whitespaces and .tag files
Posted by "Milanez, Marcus" <Ma...@diebold.com>.
OK Hassan, thanks a lot! If I could get this directive working with .tag
files I would appreciate a lot more, but if I couldn't find a way, I'll
try your suggestion!
Just a final questions: should it be working or not? I mean, ths
specification for trim-directive-whitespaces says that it could not work
in these cases?
Thanks a lot for your time!
Marcus Milanez
-----Mensagem original-----
De: Hassan Schroeder [mailto:hassan.schroeder@gmail.com]
Enviada em: sexta-feira, 9 de maio de 2008 11:38
Para: Tomcat Users List
Assunto: Re: trim-directive-whitespaces and .tag files
On Fri, May 9, 2008 at 7:28 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> I think it won't be possible to trim white spaces from .tag files
> uwing this directive then...
If minimizing white space is critical for you, you might try something
with the String taglib -- maybe wrap a string:squeeze around the whole
tag body. Just a first-cup-of-coffee thought... :-)
HTH,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: trim-directive-whitespaces and .tag files
Posted by Hassan Schroeder <ha...@gmail.com>.
On Fri, May 9, 2008 at 7:28 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> I think it won't be possible to trim white spaces from .tag files uwing
> this directive then...
If minimizing white space is critical for you, you might try something
with the String taglib -- maybe wrap a string:squeeze around the
whole tag body. Just a first-cup-of-coffee thought... :-)
HTH,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RES: trim-directive-whitespaces and .tag files
Posted by "Milanez, Marcus" <Ma...@diebold.com>.
I'll answer my own question here. I guess this directive takes effect
during compile time 'cause when I try to pre-compile my jsps with the
<url-pattern>*.tag</url-pattern> in my web.xml file, I come accross with
the following error:
"file: /appFolder/WEB-INF/tags/fields/data.tag(1,14) <%@ attribute
directive can only be used in a tag file"
I think it won't be possible to trim white spaces from .tag files uwing
this directive then...
-----Mensagem original-----
De: Milanez, Marcus
Enviada em: sexta-feira, 9 de maio de 2008 11:21
Para: 'Tomcat Users List'
Assunto: RES: trim-directive-whitespaces and .tag files
Hi Hassan,
No effect. I think that's because we never reference .tag files
directly. My guess is that when tomcat engine compiles .tag files into
.java files, it ignores my trim-directive.
Do you know how this directive work? Does it remove white spaces in
every request (like a filter) or during compiling time?
Thank you!
-----Mensagem original-----
De: Hassan Schroeder [mailto:hassan.schroeder@gmail.com]
Enviada em: sexta-feira, 9 de maio de 2008 11:17
Para: Tomcat Users List
Assunto: Re: trim-directive-whitespaces and .tag files
On Fri, May 9, 2008 at 7:04 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> I'm successfully using trim-directive-whitespaces in my web.xml file,
> clearing unecessary white spaces from my pages. The only problem is
> that .tag files content is not affected by this directive.
What happened when you added this:
<jsp-config>
<jsp-property-group>
<url-pattern>*.tag</url-pattern>
<trim-directive-whitespaces>true</trim-directive-whitespaces>
</jsp-property-group>
</jsp-config>
Did it produce an error, or just no effect?
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: trim-directive-whitespaces and .tag files
Posted by Hassan Schroeder <ha...@gmail.com>.
On Fri, May 9, 2008 at 7:21 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> No effect. I think that's because we never reference .tag files
> directly.
Probably -- it was worth a shot, I figured :-)
> Do you know how this directive work? Does it remove white spaces in
> every request (like a filter) or during compiling time?
No idea, but it you've got it working for JSP files, it should be pretty
easy to compare the compiled files in /work with and without it.
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RES: trim-directive-whitespaces and .tag files
Posted by "Milanez, Marcus" <Ma...@diebold.com>.
Hi Hassan,
No effect. I think that's because we never reference .tag files
directly. My guess is that when tomcat engine compiles .tag files into
.java files, it ignores my trim-directive.
Do you know how this directive work? Does it remove white spaces in
every request (like a filter) or during compiling time?
Thank you!
-----Mensagem original-----
De: Hassan Schroeder [mailto:hassan.schroeder@gmail.com]
Enviada em: sexta-feira, 9 de maio de 2008 11:17
Para: Tomcat Users List
Assunto: Re: trim-directive-whitespaces and .tag files
On Fri, May 9, 2008 at 7:04 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> I'm successfully using trim-directive-whitespaces in my web.xml file,
> clearing unecessary white spaces from my pages. The only problem is
> that .tag files content is not affected by this directive.
What happened when you added this:
<jsp-config>
<jsp-property-group>
<url-pattern>*.tag</url-pattern>
<trim-directive-whitespaces>true</trim-directive-whitespaces>
</jsp-property-group>
</jsp-config>
Did it produce an error, or just no effect?
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: trim-directive-whitespaces and .tag files
Posted by Hassan Schroeder <ha...@gmail.com>.
On Fri, May 9, 2008 at 7:04 AM, Milanez, Marcus
<Ma...@diebold.com> wrote:
> I'm successfully using trim-directive-whitespaces in my web.xml file,
> clearing unecessary white spaces from my pages. The only problem is that
> .tag files content is not affected by this directive.
What happened when you added this:
<jsp-config>
<jsp-property-group>
<url-pattern>*.tag</url-pattern>
<trim-directive-whitespaces>true</trim-directive-whitespaces>
</jsp-property-group>
</jsp-config>
Did it produce an error, or just no effect?
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RES: trim-directive-whitespaces and .tag files
Posted by "Milanez, Marcus" <Ma...@diebold.com>.
Just for a matter of reference, I'm currently using Tomcat 6.0.14 under
Windows 2003 server.
Thanks again!
-----Mensagem original-----
De: Milanez, Marcus
Enviada em: sexta-feira, 9 de maio de 2008 11:04
Para: 'Tomcat Users List'
Assunto: trim-directive-whitespaces and .tag files
Hi,
I'm successfully using trim-directive-whitespaces in my web.xml file,
clearing unecessary white spaces from my pages. The only problem is that
.tag files content is not affected by this directive. Is there a way to
make it work? I've searched a lot for it and couldn't find anything...
I'm using the following directive at this moment:
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<trim-directive-whitespaces>true</trim-directive-whitespaces>
</jsp-property-group>
</jsp-config>
Any suggestion?
Thank you all!
Marcus Milanez
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org