• Post Reply Bookmark Topic Watch Topic
  • New Topic

leading whitespaces in xml output  RSS feed

 
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: 65833
134
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!