struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric SCHULTZ <>
Subject RE: Extra Lines in Compiled JSP
Date Fri, 20 Feb 2004 21:44:55 GMT
Good afternoon...

I had a similar issue generating XML files.  I realise white-space shouldn't
be an issue in XML but it was for our browser.  Perhaps you are having a
similar issue in your case, so this might help.

When I followed convention and put the <%@ ... %> directives first, and then
my <? xml ... ?> line the browser couldn't validate the XML because it
didn't start on the first character of the first line (i.e.: because of all
the blank lines).

The solution was to ignore the convention and start my file with <? xml ...
?> and then put my <%@ ... %> directives and then put the rest of my JSP.
Perhaps you could start your JSP page with <html> and the put the page and
taglib directives?

In what way is your HTML code being screwed up?

Eric Schultz
Technical Leader
Conseiller Technique
Specialist in interactive business solutions
Specialiste en solutions d'affaires interactives
14 Commerce Place, 5th floor
Nun's Island, QC  H4E 1T5
t: 514 768-1000
f: 514 768-7680

-----Original Message-----
From: Jerry Jalenak []
Sent: February 20, 2004 11:07
To: ''
Subject: Extra Lines in Compiled JSP

Hi All,

I should know how to fix this, but am at a loss.  At the top of my JSP I
have the following lines:

<%@ taglib uri="" prefix="bean" %>
<%@ taglib uri="/display" prefix="display" %>
<%@ taglib uri="" prefix="html" %>
<%@ taglib uri=""
prefix="nested" %>
<%@ taglib uri="" prefix="tiles"
<%@ page language="java" %>
<%@ page contentType="text/html; charset=UTF-8" %>

When I look at the compiled JSP, there are seven blank lines (i.e.
out.write("\r\n"); ).  Is there anyway to have the JSP compiler (were
running Tomcat 5.0.18 Stable) NOT generate these lines?  I guess they come
from the <%.... %> sources lines, but it really screws up my generated HTML


Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

This transmission (and any information attached to it) may be confidential
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible
delivering the transmission to the intended recipient, be advised that you
have received this transmission in error and that any use, dissemination,
forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify
LabOne at the following email address:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message