This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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
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