Recently was faced the problem where the div was fixed length and it contained a very very long string. The long string was jutting out of the div. In order to overcome that first I modified the CSS and added overflow:hidden property to the div in question. Then the problem was that users were not able to see the entry properly. This was easily fixed for IE 6 and IE 7 by adding word-wrap:break-word to css. This property is not supported by firefox. The application was java based so could not use some already nice functions in other languages (e.g. wordwrap in php). To achieve this in java one must include a non printing character ( like <wbr/> ) after each character. This could be done easily by writing a method in Tag Library.
I have written that method in Tag Library and tested it. IT WORKS.