aspose file tools*
The moose likes JSP and the fly likes java new line not recognized in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "java new line not recognized in jsp" Watch "java new line not recognized in jsp" New topic
Author

java new line not recognized in jsp

Harshana Dias
Ranch Hand

Joined: Jun 11, 2007
Posts: 327
i have just use System.out.print("\n") in a for each iteration expecting new lines as if we put
. Any reason why it does not work with System.out.print("\n")

Harshana Dias
Ranch Hand

Joined: Jun 11, 2007
Posts: 327
:banghead: though in server side new line interprets and add a new line, but when it comes to client side browser skips the empty lines. So it displays in a row instead of breaking in to lines.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Remember that all a JSP does is to create an HTML page to send to the browser. So yes, the browser ignores white-space in HTML. Also System.out.print does not even emit the output to the response. It'll just send it to the console/log.

If that seems odd to you, this article might help.

Also, scriptlets in a JSP are obsolete and discredited. Please read this JspFaq entry.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java new line not recognized in jsp