It doesn't seem like there are any unnecessary \r\n's in jsp's. If one was
to write :

<jsp:include page="top.jsp" />
<jsp:include page="middle.jsp" />
<jsp:include page="bottom.jsp" />

Then yes there will be \r\n's between the output of each include. 

If the \r\n's absolutely can not be there then take them out via:

<jsp:include page="top.jsp" /><jsp:include page="middle.jsp" /><jsp:include
page="bottom.jsp" />

I do agree that one needs to be careful with \r\n's especially when dealing
with different content types (i.e. application/pdf,
application/vnd.ms-excel, etc.)


-----Original Message-----
From: Sergei Batiuk [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 24, 2001 7: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 ----- 
From: Aaron Tavistock 
To: Orion-Interest 
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