wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes How to wrap text coming from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to wrap text coming from database " Watch "How to wrap text coming from database " New topic
Author

How to wrap text coming from database

yoga babu
Greenhorn

Joined: Jul 18, 2006
Posts: 17
Hai friends,

I am taking datas from database table and dispalying as a report using jsp,servlet.i have URL field ,its having more than 50chracter,so in report this particular field is so long..so i want to wrap text into 2 or 3 lines.



Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbcdbc:pro","pr","pr");
Statement stat = con.createStatement();
ResultSet rs = stat.executeQuery ("SELECT * FROM BL_BILL WHERE startdate BETWEEN '"+sta+"' AND '"+sta1+"' ");
%>

<table border="2" >
<tr>

<td><font color="green" size=2>URL</td>
while(rs.next())
{
String url =rs.getString(1);
%>

<td><font size=2 color="black"><%= url %></td>
<%
}
%>

pls suggest me how to make url field into 2 lines.

Thank You

Regards
Babu
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

There is nothing in JSP for doing this.
The solution would be to use HTML or CSS.

Moving to HTML/Javascript.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
Consider Paul's rocket mass heater.
 
subject: How to wrap text coming from database
 
Similar Threads
view record from database using click event in jsp
When I validate my code I hit this problem...
how to handle Null values?
How to check if textboxes are null
Conversion configuration objects from ASP to JSP