Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 26th, 2006, 01:05 AM
Authorized User
 
Join Date: May 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default inserting in Break in jsp

hi i have a string as follows in a java bean : this should put \r\n this sentence in \r\n two lines.

when i retrieve this in my jsp it displays as a single line.

i am using JSTL in my jsp, and since the escape sequence are not identified in html i replaced the "\r\n" with "<bR>" but when i see the page it comes as follows:
this should put <br> this sentence in <br> two lines.
and if u see the source it is like:
this should put &lt;br&gt; this sentence in &lt;br&gt; two lines.

i would like to know how to resolve this and also how to replace multiple \r, \n, in any sequence, with a single <BR>

Thanks in advance
 
Old October 9th, 2006, 08:53 PM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Um, are you sure you're doing a String.replace("\r\n", "<br>") ? It seems like you're doing String.replace("\r\n", "&lt;br&gt;") instead. Please confirm that you've tried simply "<br>" and used c:out with source="true".

Jon Emerson
http://www.jonemerson.net/





Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting data into database using a jsp ronnie JSP Basics 4 January 15th, 2015 11:35 AM
Inserting picture into Sqlserver using JSp Thushara Jacob Pulickal Pro JSP 0 May 4th, 2006 12:42 AM
Please Help. mr_newreq.jsp:78: jsp:useBean can't f batken JSP Basics 0 February 22nd, 2006 09:56 PM
how do i break it up? kuehhc Beginning PHP 3 January 19th, 2005 09:52 AM
Unable to Break at Break point Girishbk VB.NET 2002/2003 Basics 0 January 18th, 2005 08:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.