This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JSP and the fly likes shrink my jsp page response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "shrink my jsp page response" Watch "shrink my jsp page response" New topic

shrink my jsp page response

Abhi Kedare

Joined: Dec 10, 2010
Posts: 9
Hi all,
I want to shrink my jsp page text/html response as current page has lot more html code.
please give me solution for removing whitespace and carriage line feed for part of html code block or whole html code in jsp AT RUNTIME ( at the time of request response processing ) .
I just want decrease load time of my page

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63052

Have you 100% determined that removing whitesapce will actually make a difference before going through all the trouble?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32304

See the servlet filter to compress your HTML. This reduces the amount of bandwidth used to transmit the page. Also make sure css and javascript is externalized.

Before you do this, you should make sure the time is coming from actually transmitting the page. If it takes 5 seconds to render your page and .2 seconds to transmit it, the improvement from shrinking the page won't help you.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
It is sorta covered in the JavaRanch Style Guide.
subject: shrink my jsp page response
It's not a secret anymore!