At 11:26 �� 23/7/2000 +0530, you wrote:
>Hi,
>I m new to Servlets, hence apologize in advance
>for wasting u r time 'n' energy in replying this.
>
>Please consider following imp. of doGet() -
>
>public void doGet(HttpServletRequest req, HttpServletResponse res)
>throws IOException {
>                 PrintWriter out = res.getWriter();
>//PROBLEM       res.setContentType("text/html");
>                 out.println("line 1");
>                 out.println("line 2");
>                 out.println("line 3");
>         }
>
>Now, I get the output as : line 1line 2line 3
>But if I change the contentType to "text/plain", output is -
>line 1
>line 2
>line 3
>
>Please clarify, why new-lines are not printed in "text/html"??

This is basic HTML. Try for instance,

out.println("line 1<p>");
out.println("line 2<p>");

<p> stands for "paragraph" in HTML world. Ofcourse there are other methods
(other HTML tags) which will make the job, since the <p> leaves a lot of
space between each paragraph. For example the <pre> tag may be better for
you, use it like:

out.println("<pre>line 1");
out.println("line 2</pre>");

>TIA
>ips
>


Regards
Slavikos


################################################################
Filippos Slavik
Forthnet R&D, Hrakleio, Greece
e-mail : [EMAIL PROTECTED]
phone : (+3) 081 391230
################################################################

"The software said 'runs on Win95 or better,' so I installed it
on Linux..."

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to