Why don't you write a bodyTag that you use like
<myTag:removeAllStupidWhiteSpaceThatIDontLike>
<%
  foo();
%><%
  bar();
%>
</myTag:removeAllStupidWhiteSpaceThatIDontLike>
 
And in your code, analyse bodycontent before it is written...?
 
ie bodyContent.toString().indexOf("\r\n");
 
or something like that.
 
I agree this will be difficult when including different pages.
 
 
Johan
----- Original Message -----
Sent: Tuesday, July 24, 2001 3:32 PM
Subject: Re: Orion's JSP generated code

<%
  foo();
%><%
  bar();
%>
 
This looks like a nice idea! However:
  • If I have several jsp's to include into one page, each will add the \r\n.
  • My opinion is that this is not a philsophical difference, but something that orion server developers or JSP specification developers missed. I can always add as many \r\n's to my page as I wish. But there is no way to remove unnecessary ones.
Best regards,
Sergei.
 
 
----- Original Message -----
Sent: Monday, July 23, 2001 10:00 PM
Subject: RE: Orion's JSP generated code

Umm, the \r\n is probably something you are including inadvertently.  I'm going to speculate that you have a construct that looks like this...
 
<%
  foo();
%>
<%
  bar();
%>
 
between the first close and next open, you have a \r\n.  While it looks uglier on the JSP page it should clear your line break if you did this...
 
<%
  foo();
%><%
  bar();
%>
 
Now why JSP doesn't clean this up for you an PHP does probably boils down to a philosophical difference.  PHP is cleaning it up for you, where JSP is giving you exactly what you asked for.  I'd guess this is because PHP is pretty much pure web, where JSP is intended to be portable into other formats that may think whitespace is important.
-----Original Message-----
From: Sergei Batiuk [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 20, 2001 3:25 AM
To: Orion-Interest
Subject: Orion's JSP generated code

Hi forum,
 
I have noticed that when I use scriplets or tags in my JSPs , orion puts "\r\n" into the output stream code for each tag. This results in many blank lines in the generated HTML code. In comparison, PHP scriplets do not produce these blank lines. Does anyone know how to "beautify" the generated code?
 
Thanks in advance,
Sergei.

Reply via email to