Hi,
I am able to get records from the database, mySQL and print it on
the screen using out.print(). But for the first output I am also
getting [] along with the output. I have tried using trim() but it
doesn't help. I have removed all the HTML related tags from the jsp
file and still it gives the output with []. Following is what I am
getting;
[]white
blue
red
green
Earlier, I was getting [] in front of every output, but after I
started using out.print() instead of out.println() the [] infront of
other output values except the first one.
Can anyone help me with this. Thanks you all in advance.
regards,
Gary
Oliver Wong - 21 Sep 2005 15:54 GMT
> Hi,
> I am able to get records from the database, mySQL and print it on
[quoted text clipped - 14 lines]
>
> Can anyone help me with this. Thanks you all in advance.
Two things:
1) Using out.print() instead of out.println() or vice versa should not
affect the behaviour you're seeing here.
2) Are you sure it's two characters, the first character being '[' and
the second character being ']', and not just a single box character? In the
later case, it may be that you're trying to print a non-printable character.
In the former case, you've got a mysterious bug hidden somewhere in your
code.
- Oliver
Roedy Green - 21 Sep 2005 17:41 GMT
>[]white
can you write a sscce that demonstrates how you do this?
see http://mindprod.com/jgloss/sscce.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Gary - 21 Sep 2005 19:37 GMT
Thank you all for your responses. I solved the problem. It is a single
box [] that appeared before the output. I added out.clear(); before
printing out the output out.print(String); and it removed the box []
that was appearing before the output.
Again, thank you all for your quick response.
regards,
Gary