Sasi

>I have created an application using jsp. I am using oc4j for application
>server. I want to remove all the white spaces created by the jsp file.
>How to do that?.
The easiest way would be to remove them from your source file.  Every new
line in the HTML parts of the page will add white space so:
---jsp code---

<%@ page import = "num.NumberGuessBean" %>

<jsp:useBean id="numguess" class="num.NumberGuessBean" scope="session"/>
<jsp:setProperty name="numguess" property="*"/>

<html>
<head><title>Number Guess</title></head>
---end jsp code---

This ends up with 6 blank lines at the head of the file.

---html code---






<html>
<head><title>Number Guess</title></head>
---end html code---

You could reduce the white space by writing these all on the same line but
readability goes out the window.
---jsp code---
<%@ page import = "num.NumberGuessBean" %><jsp:useBean id="numguess"
class="num.NumberGuessBean" scope="session"/><jsp:setProperty
name="numguess" property="*"/><html><head><title>Number Guess</title></head>
---end jsp code---

However, there is another way, which can also do the trick for you.  You
could configure a filter to process your jsp's output to remove extra white
space.  But this will have an overhead cost that probably isn't worth it.

Is it really that much of a problem?

HTH
Andrew
Pro Java Servlets 2.3
http://www.amazon.co.uk/exec/obidos/ASIN/186100561X

-----Original Message-----
From: Sasirekha Balraj, BSC, Guindy, Chennai. [mailto:[EMAIL PROTECTED]]
Sent: 09 August 2002 10:21
To: JDJList
Subject: [jdjlist] Removing white spaces from jsp pages

Hi All,
Have a nice day!...
I have created an application using jsp. I am using oc4j for application
server. I want to remove all the white spaces created by the jsp file.
How to do that?.
Thanks in advance.
regards
sasi

To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm


To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to