Regardless of whether you like it or not, I hate to say it but it is you that is including these not Orion.  You can easily remove them, you just don't like the way to do it. 
 
In fact I'm fairly sure its part of the JavaServer Pages spec that everything is included on the resulting page.  I would also disagree that its an oversight, personally I would rather have everything I put there rather than some filter to clean up after me.  As a case in point I have a jsp page that generates a PDF file on the fly, if the line breaks were not included verbatim it would take alot of figuring out where the line breaks truly belong and artifically inserting them.
 
If these \r\n's are that significant of a problem for you and you really find that you can't clean up these youself, you can always do things the hard way and avoid opening and closing the jsp delimiters, for example do includes like this:
 
<%
  pageContext.include(urlA);
  pageContext.include(urlB);
%>
 
But then you're losing the clarity of your for a few bytes of saved space.  
 
 -----Original Message-----
From: Sergei Batiuk [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 24, 2001 6:33 AM
To: Orion-Interest
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