K
K
KhanTengri2010-10-13 10:09:54
Java
KhanTengri, 2010-10-13 10:09:54

How to force JSP(jspx) documents to retain final HTML formatting?

JSP documents (those with XML syntax and .jspx extension) remove all formatting when generating the resulting HTML. All html markup is simply written in a line.
How can I make jspx documents retain formatting like simple JSP pages?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mitnlag, 2010-10-13
@mitnlag

Overlay on top of the resulting xml xslt, which will format nicely ;-)

H
hippoage, 2010-10-13
@hippoage

Seriously, put it in CDATA or not use jspx:

<![CDATA[&nbsp;]]>

In fact, the problem at this level is not normally solved. If it's just inconvenient for debugging, then look through firebug and similar things (by the way, as far as I remember, one of the browsers, like Opera, formats itself before displaying the source). If spaces require layout, then layout so that it does not require or insert nbsp.
I studied this issue a little and came to the conclusion that it doesn’t make much sense for a person to write jspx, it’s more convenient jsp (nbsp, conditional comments for IE, javascript and the less-than sign, preserving formatting and gaps, ...). Only for generating and updating utilities it is convenient, because they can work with xml tree.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question