I know, I know,
I replied to the wrong message.
But that's because this mailing list is very inconsistent. Sometimes a reply
is to the original sender. Sometimes a reply is to the whole list. I think
this is very confusing.
Anyway, here was my answer. No replying to the correct post ;-)
Hey here's a post for Joseph again ;-)
<Joseph>
Buy a book about HTML and RTFM
There are mailing lists about HTML too you know
</Joseph>
However, I don't think this post is really OT. Because I have a utility that
I often use in JSP to do this.
Your JSP is generating HTML, and in HTML, to go to a new line, you need <BR>
or <P> tags.
another approach is to put the whole block in <PRE> </PRE> tags.
Here's my code:
public static String lineBreak(String input){
// convert linebreak to <B>
StringBuffer buff = new StringBuffer();
if (input != null){
StringTokenizer st = new StringTokenizer(input,"\n",false);
while (st.hasMoreTokens()){
buff.append(st.nextToken());
buff.append("<BR>");
}
}
return buff.toString();
}
Geert Van Damme
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Clair e Simon
> Sent: donderdag 24 mei 2001 0:27
> To: [EMAIL PROTECTED]
> Subject: Text from a database
>
>
> Hi,
>
> I did wrote a text in my database.
>
> The text is 10 lines, but it show on the web page just as a block without
> returns.
>
> The text is this way;
>
> line 1
>
> line2
>
> line3
>
> But on the webpage, it display this way;
>
> line1line2line3 all in one block of text.
>
> What should I do in JSP, to change that to format correctly my text?
>
> Bye
>
> Simon
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets