It's all in the JavaDocs, which you should read so you know what it's doing,
but this is the basic code:
StringTokenizer st = new StringTokenizer(myString, "\n\r");
while (buf.hasMoreTokens()) {
out.println(buf.nextToken() + "<br>");
}
Greg
-----Original Message-----
From: Shashank Arora [mailto:niceguyleo@i...]
Sent: Thursday, November 14, 2002 7:46 AM
To: Servlets
Subject: [servlets] RE: Problems with getParameter() function!!
Hey Greg :)
thanks 4 ur tip...but i really din't know how do i replace the /n's
and /r's when tokenising the given String...can u let me know a bit bout
that..it would be really nive if u can write me an exapmle.
i know that's a bit of trouble but if u can help me that way i'll be so
much greatful.
Thanks,
Shashank Arora
> When you read the data to display use a StringTokenizer, and tokenize
the \n
and \r's, then replace them with <br>.
Greg
-----Original Message-----
From: Shashank Arora [mailto:niceguyleo@i...]
Sent: Wednesday, November 13, 2002 9:38 AM
To: Servlets
Subject: [servlets] Problems with getParameter() function!!
Hi :)
I am having this very weird problem. I have this html from wherein i am
inputtin data using different fields which includes a textarea. and i need
the data to be printed at the client end in the same form as it is
inputted. For that i am using the property of textarea i.e.
(wrap=Physical) and when i am accesssin the data f the form using the
getParameter() function the data seems to be lsing all its formatting..and
then it's inserted into the database and when i am displaying the data
from the database it is displayed as simple single line of text without
any formatting like it had when the user entered it using the form.
i hope i am clear with my problem but i am not to sure about the area of
the problem whether it's realy the getParameter() function or something
else that is creating the problem.
if anybody can help me out i'll really be so much greatful.
Thanks n regards.
Shashank Arora