I have a StringBuffer object in B.jsp that collects various String objects passed from some A.jsp and displays it on the screen.
B.jsp:
I am expecting the comments text to be multi-lined. My problem is that when my StringBuffer is displayed, the comments text is not wrapped and thus, runs all the way and over the end of the screen, displaying an unsightly horizontal scroll bar. I realize I can write a method that would parse the line and wrap it accordingly or change the format into table cells but I was wondering if there's already a package out there available that will provide such wrapping services for me?
Thanks.
B.jsp:
Code:
String name_input = request.getParameter("name");
String address_input = request.getParameter("address");
String comment_input = request.getParameter("comment");
StringBuffer sb = new StringBuffer();
sb.append("Name: "+name_input);
sb.append("\n");
sb.append("Address: "+address_input);
sb.append("\n");
sb.append("Comments: "+comment_input);
sb.append("\n");
I am expecting the comments text to be multi-lined. My problem is that when my StringBuffer is displayed, the comments text is not wrapped and thus, runs all the way and over the end of the screen, displaying an unsightly horizontal scroll bar. I realize I can write a method that would parse the line and wrap it accordingly or change the format into table cells but I was wondering if there's already a package out there available that will provide such wrapping services for me?
Thanks.