Solve the problem of rs.getstring () in JSP and open the table when one line of Chinese is too long

Source: Internet
Author: User
Tags mysql database
js| Solutions | questions | Chinese

The recent use of JSP to do news release found that the rs.getstring () obtained by the string inside the space and the line of change are not shown,

First analysis of the reasons, I used the MySQL database, the news content used is the text type, view the database uploaded news found inside the line and space can be displayed, this explains, affirmation is to use rs.getstring when the problem, first view the java.sql.* API wants to use a different get method, try a few results,

There are similar problems on the web, but most of them are done in a servlet or in a bean, and I think it's complicated.

Finally found the solution in the call Rs.getstring page inside the table to add style= "Word-break:break-all"

The <pre>rs.getstring () <> label is used to show the problem of line wrapping. of which the <pre></pre> must not be less

However, when one line of content is too long, the form will still be stretched, and needs to be modified in the form Hu style Property style= "table-layout:fixed Word-wrap:break-word" so as to really solve the problem of Chinese open form.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.