Re: carriage returns
The problem was that the receiving system would choke when the XML responses were too long, so gzip wouldn't have helped it. I'm not sure what system/app they were using as it was with an external service provider, but it sounds pretty broken regardless. Probably some kind of fixed buffer overrun, yuck! -ed On 6/14/05, Dave Newton <[EMAIL PROTECTED]> wrote: > Ed Griebel wrote: > > >We had a problem with XML having too many carriage returns and > >whitespace for a downstream system. > > > Heck, XML has too much NON-whitespace, too ;) > > >To solve the problem I wrote a > >simple javax.servlet.Filter instance that would get the response and > >strip out extraneous stuff using String.replaceAll() on the output > >from a HttpServletResponseWrapper instance. Not the most efficient, > >but it was expedient and the XML output was relatively small, > >especially when compared with the app's HTML output. > > > > > Was the difference between the performance of the .replaceAll so much > better than a gzip filter? > > Dave > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: carriage returns
Thanks Jason, that is more like what I was looking for. From: Jason Lea <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" To: Struts Users Mailing List Subject: Re: carriage returns Date: Wed, 15 Jun 2005 10:17:12 +1200 You can get Tomcat-5's JSP compiler to remove some whitespace in conf/web.xml you can set trimSpaces to true. It will remove whitespace between tags. eg Would be reduced to but abc def would be abc def draegoon Z wrote: Hey guys, I'm finally sick of all the unwanted carriage returns created by tiles and struts tags. I searched the archives and found this trick: but it doesn't fix everything, especially comments. Has anyone else gotten sick of this and came up with a quick and clean solution? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: carriage returns
Thanks Jason, that is more like what I was looking for. From: Jason Lea <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" To: Struts Users Mailing List Subject: Re: carriage returns Date: Wed, 15 Jun 2005 10:17:12 +1200 You can get Tomcat-5's JSP compiler to remove some whitespace in conf/web.xml you can set trimSpaces to true. It will remove whitespace between tags. eg Would be reduced to but abc def would be abc def draegoon Z wrote: Hey guys, I'm finally sick of all the unwanted carriage returns created by tiles and struts tags. I searched the archives and found this trick: but it doesn't fix everything, especially comments. Has anyone else gotten sick of this and came up with a quick and clean solution? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: carriage returns
> I'm finally sick of all the unwanted carriage returns created by > tiles and struts tags. > I searched the archives and found this trick: > > > > > > but it doesn't fix everything, especially comments. > > Has anyone else gotten sick of this and came up with a quick > and clean solution? We use a filter that removes white-space from html, css, and javascript output. It's pretty straight forward, but there are a few caveats. For instance, it probably shouldn't remove extra white-space inside of a . This is a clean solution, configuration-wise. - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: carriage returns
You can get Tomcat-5's JSP compiler to remove some whitespace in conf/web.xml you can set trimSpaces to true. It will remove whitespace between tags. eg Would be reduced to but abc def would be abc def draegoon Z wrote: Hey guys, I'm finally sick of all the unwanted carriage returns created by tiles and struts tags. I searched the archives and found this trick: but it doesn't fix everything, especially comments. Has anyone else gotten sick of this and came up with a quick and clean solution? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jason Lea
Re: carriage returns
Ed Griebel wrote: We had a problem with XML having too many carriage returns and whitespace for a downstream system. Heck, XML has too much NON-whitespace, too ;) To solve the problem I wrote a simple javax.servlet.Filter instance that would get the response and strip out extraneous stuff using String.replaceAll() on the output from a HttpServletResponseWrapper instance. Not the most efficient, but it was expedient and the XML output was relatively small, especially when compared with the app's HTML output. Was the difference between the performance of the .replaceAll so much better than a gzip filter? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: carriage returns
We had a problem with XML having too many carriage returns and whitespace for a downstream system. To solve the problem I wrote a simple javax.servlet.Filter instance that would get the response and strip out extraneous stuff using String.replaceAll() on the output from a HttpServletResponseWrapper instance. Not the most efficient, but it was expedient and the XML output was relatively small, especially when compared with the app's HTML output. -ed On 6/14/05, draegoon Z <[EMAIL PROTECTED]> wrote: > Hey guys, > > I'm finally sick of all the unwanted carriage returns created by tiles and > struts tags. > I searched the archives and found this trick: > > > > > > but it doesn't fix everything, especially comments. > > Has anyone else gotten sick of this and came up with a quick and clean > solution? > > Thanks. > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: carriage returns
Aehm, this is not quite true. If you look in the generated jsp you will see a bunch of lines like this: _jsp_string14 = "\r\n ".toCharArray(); (this is for resin users, in tomcat jsps it will be somewhere in the code with write()) The jsp compiler usually handles all whitespaces before and after a tag as html code. This means, that if your IDE fills out idents with spaces, you have about 10% additional garbage in a tag heavy page. I've seen pages with 10K garbage, even with zip-on it's still waste of cpu and bandwith. Regards Leon > -Ursprüngliche Nachricht- > Von: Jason Sheldon [mailto:[EMAIL PROTECTED] > Gesendet: Dienstag, 14. Juni 2005 23:17 > An: Struts Users Mailing List > Cc: struts-user@jakarta.apache.org > Betreff: Re: carriage returns > > What are your concerns with unwanted carriage returns? > > Do you think they are adding to the weight of the page? If > you a using a server that support the 1.1 http spec(with > compression), then the carriage returns apply a negible > amount of weight to the page. > > Jason > > On 6/14/05, draegoon Z <[EMAIL PROTECTED]> wrote: > > Hey guys, > > > > I'm finally sick of all the unwanted carriage returns > created by tiles > > and struts tags. > > I searched the archives and found this trick: > > > > > > > > > > > > but it doesn't fix everything, especially comments. > > > > Has anyone else gotten sick of this and came up with a > quick and clean > > solution? > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: carriage returns
Aehm, this is not quite true. If you look in the generated jsp you will see a bunch of lines like this: _jsp_string14 = "\r\n ".toCharArray(); (this is for resin users, in tomcat jsps it will be somewhere in the code with write()) The jsp compiler usually handles all whitespaces before and after a tag as html code. This means, that if your IDE fills out idents with spaces, you have about 10% additional garbage in a tag heavy page. I've seen pages with 10K garbage, even with zip-on it's still waste of cpu and bandwith. Regards Leon > -Ursprüngliche Nachricht- > Von: Jason Sheldon [mailto:[EMAIL PROTECTED] > Gesendet: Dienstag, 14. Juni 2005 23:17 > An: Struts Users Mailing List > Cc: struts-user@jakarta.apache.org > Betreff: Re: carriage returns > > What are your concerns with unwanted carriage returns? > > Do you think they are adding to the weight of the page? If > you a using a server that support the 1.1 http spec(with > compression), then the carriage returns apply a negible > amount of weight to the page. > > Jason > > On 6/14/05, draegoon Z <[EMAIL PROTECTED]> wrote: > > Hey guys, > > > > I'm finally sick of all the unwanted carriage returns > created by tiles > > and struts tags. > > I searched the archives and found this trick: > > > > > > > > > > > > but it doesn't fix everything, especially comments. > > > > Has anyone else gotten sick of this and came up with a > quick and clean > > solution? > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: carriage returns
On 6/14/05, draegoon Z <[EMAIL PROTECTED]> wrote: > > I'm finally sick of all the unwanted carriage returns created by tiles and > struts tags. > I searched the archives and found this trick: > Just to clarify: If the trick you used worked on the CRs you see around the tags, that means the "unwanted carriage returns" aren't being "created by tiles and struts tags", it means you're putting them in there yourself. That's why when you eliminated the CRs in your JSP template text, they disappeared in the JSP output. ;) Hubert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: carriage returns
What are your concerns with unwanted carriage returns? Do you think they are adding to the weight of the page? If you a using a server that support the 1.1 http spec(with compression), then the carriage returns apply a negible amount of weight to the page. Jason On 6/14/05, draegoon Z <[EMAIL PROTECTED]> wrote: > Hey guys, > > I'm finally sick of all the unwanted carriage returns created by tiles and > struts tags. > I searched the archives and found this trick: > > > > > > but it doesn't fix everything, especially comments. > > Has anyone else gotten sick of this and came up with a quick and clean > solution? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Carriage Returns in MessageResources.properties
will try them all thanks Catalin and Bill. On Thu, 16 Dec 2004 08:57:15 -0500, Bill Siggelkow <[EMAIL PROTECTED]> wrote: > Maybe try using a double slash (\\r\\n) ... > > Richard Reyes wrote: > > > Hello Guys, > > > > How can I include a carriage return inside a properties file. I tried > > \r\n and it show as \r\n on the > > emails being sent. > > > > Thanks > > Richard > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Carriage Returns in MessageResources.properties
Hi, try tu put in your application.properties for CARRIAGE RETURN (CR) and NEW LINE (NL) the unicode value: CR: \u000D NL: \u000A in my application.properties this is work for special characters Catta On Thu, 16 Dec 2004 13:49:10 +0800, Richard Reyes <[EMAIL PROTECTED]> wrote: > Hello Guys, > > How can I include a carriage return inside a properties file. I tried > \r\n and it show as \r\n on the > emails being sent. > > Thanks > Richard > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Carriage Returns in MessageResources.properties
Maybe try using a double slash (\\r\\n) ... Richard Reyes wrote: Hello Guys, How can I include a carriage return inside a properties file. I tried \r\n and it show as \r\n on the emails being sent. Thanks Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]