servlets

Discussion in 'Java' started by suhas, Jun 9, 2011.

  1. suhas

    suhas Guest

    how to create a new line in servlets?? if i use
    Printwriter out= res.getwriter()
    out.print()
    no new line is creating...please help me out...
     
    suhas, Jun 9, 2011
    #1
    1. Advertising

  2. suhas

    markspace Guest

    On 6/8/2011 10:14 PM, suhas wrote:
    > how to create a new line in servlets?? if i use
    > Printwriter out= res.getwriter()
    > out.print()
    > no new line is creating...please help me out...



    Well, depends on your output format. But if you are sending HTML,
    usually a break <br /> will do the trick.

    PrintWriter out = res.getWriter();
    out.print( "<br />" );

    Not tested.
     
    markspace, Jun 9, 2011
    #2
    1. Advertising

  3. suhas

    Roedy Green Guest

    On Wed, 8 Jun 2011 22:14:19 -0700 (PDT), suhas
    <> wrote, quoted or indirectly quoted someone
    who said :

    >how to create a new line in servlets?? if i use
    >Printwriter out= res.getwriter()
    >out.print()
    >no new line is creating...please help me out...


    It has nothing to do with Servlets. print does not emit a new line;
    println does.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    How long did it take after the car was invented before owners understood
    cars would not work unless you regularly changed the oil and the tires?
    We have gone 33 years and still it is rare to uncover a user who
    understands computers don't work without regular backups.
     
    Roedy Green, Jun 9, 2011
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Beck

    Threading - ASP. Net vs JSP/Servlets

    Peter Beck, Nov 19, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    732
    S. Justin Gengo
    Nov 19, 2003
  2. No One

    Servlets?

    No One, Oct 15, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    1,304
    John Saunders
    Oct 18, 2004
  3. John C. Bollinger

    Re: Servlets and form posts/querystring

    John C. Bollinger, Jun 27, 2003, in forum: Java
    Replies:
    4
    Views:
    6,768
    John C. Bollinger
    Jul 1, 2003
  4. Miguel De Anda

    Question about servlets

    Miguel De Anda, Jun 27, 2003, in forum: Java
    Replies:
    6
    Views:
    1,282
    John C. Bollinger
    Jun 30, 2003
  5. Wendy S
    Replies:
    0
    Views:
    797
    Wendy S
    Jul 1, 2003
Loading...

Share This Page