Firstly, there is a huge problem with your JSP. By writing:
You have caused the custName variable to be declared at class level, and therefore shared by all instances of the JSP. That means that if two or more people hit your JSP at the same time, they will interfere with each other, each trying to set the variable.
Secondly, the extra whitespace you are seeing is just the nature of JSPs. All whitespace in a JSP, even that surrounding JSP declarations is preserved. To avoid it, don't use a JSP at all, but code this as a servlet where you have complete control over the output. [ July 19, 2004: Message edited by: Bear Bibeault ]
or put as many JSP coding on a single line which will then get all turned into a single line ending. Hard to read of course but sometimes the only option.
What I've at one time done is create a servlet which uses XSLT to generate output in any format using XML input delivered by another servlet together with the name of the XSL file to use for the generation. If you cache the precompiled XSL performance is excellent.