Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

leading whitespaces in xml output

 
Brian Percival
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have jsp that outputs xml.. I have leading whitespaces even before the xml header starts. How do I configure the server so I won't have stray whitespaces??
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using JSP 2.1, there is a directive to cause excess whitespace to be trimmed.

If not and you are using Tomcat, there's a way to cause Tomcat to trim the spaces.

If not, be sure that what you want emitted first is the very first template text on the page without any preceeeding JSP syntax.
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!