This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes JSP Compilation -> HTML output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Compilation -> HTML output" Watch "JSP Compilation -> HTML output" New topic
Author

JSP Compilation -> HTML output

Dave Brown
Ranch Hand

Joined: Mar 08, 2005
Posts: 301
Hi All,

I have been wondering if there is anyway to 'tweak' the process of actual HTML generation when using JSP's / JSTL etc..

I've started to wonder about the readability of the resulting HTML when using JSTL tags and wished I could do something about it, maybe there is, I just dont know and was hoping this may have been discussed before..

E.g. When writing the jsp page and using JSTL tags, I like to insert Carriage Returns (CR's) after many of the tags to improve readability. However I would like to be able to not have these CR's carried through into the resulting HTML as it does often make a mess of the resulting HTML.

Rgds,

Dave.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60739
    
  65

No disrespect, but why on earth do you care about the formatting of the HTML?

Aside from people anal enough to do a View Source in the browser, who's going to see it?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dave Brown
Ranch Hand

Joined: Mar 08, 2005
Posts: 301
Well I like to make sure what comes out is what I expect. If I could remove the extra carriage returns that get sent out, I could do that a little easier.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60739
    
  65

If it's just a spot check that you want, or to check the HTML when debugging, you don't need to do anything programmtic at all. Just do a View Source in the browser, and cut-and-paste the HTML into an IDE or other editor that has formattng capability.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSP Compilation -> HTML output
 
Similar Threads
This weeks giveaway
Java to javascript and back again...please help:)
fonts in xslt are not coming through in JSTL
struts Action for asynchronous HTTP processing
Removing html tags from a string