Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / September 2005

Tip: Looking for answers? Try searching our database.

Removing [] from the output in JSP page

Thread view: 
Gary - 21 Sep 2005 15:43 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.