• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating an HTML table in a Bean

 
Steven Lyner
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been stuck on a problem for quite a while. I have a JSP that uses a bean to fetch data from a database table. The bean returns data in an HTML table. I would like to be able to edit some of the data and update my database using <INPUT> fields. Here's my problem: Some of the strings in my table have more than one word. When I use xxx.getString("COL_NAME") as the value, only the characters before the first space are returned. If I put my getString in quotes, I get the entire string including all of the spaces at the end. When I run the JSP, I have to delete some spaces in order to alter my value. Is there any way I get insert only the characters that I need. Since I'm new to Java, any comments about how I'm approaching this would be appreciated.
Thanks,
Steve
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I get the entire string including all of the spaces at the end. When I run the JSP, I have to delete some spaces in order to alter my value....

You probably may try to use the trim() method of the
String class. This eliminates the leading and trailing spaces
of a String object.
Not sure if this is what you are looking for...
regds.
- satya
 
Steven Lyner
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Satya,
That worked great.
Thanks,
Steve
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic