File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Ajax display issue Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Ajax display issue" Watch "Ajax display issue" New topic
Author

Ajax display issue

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 602
I am new to Ajax. I have done some basic reading from the w3schools. I have a JSP page that needs to display the real time notifications on the JSP page as table row format.
When the new notification is received, I save the object received from notification in a java list.
My problem is I am unable to display the contents of this list on JSP page on each separate like. The list displays as continuous text on the JSP which is not readable. Below is the code.

Trades.jsp


messgae.html


This prints the objects inside the list on the same line one by other.

Any pointers?>
Swastik Dey
Ranch Hand

Joined: Jan 08, 2009
Posts: 1196

I guess \n\r is not recognized by html, try appending "<BR>". Correct me if I am wrong.


Swastik
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
Swastik Dey is correct, to add a new line, you need to use a
tag. You may however be better off using something like an unordered list.

Eric
trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 602
Swastik Dey wrote:I guess \n\r is not recognized by html, try appending "<BR>". Correct me if I am wrong.


I tried with <BR> And it still does not work. The next object in the list gets printed on the same line.


Swastik Dey
Ranch Hand

Joined: Jan 08, 2009
Posts: 1196

What does textDoc contain? New line characters or <br>?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56205
    
  13

If it's a list, why aren't you using a list?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
Aren't the new lines you are talking about being added here:

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 602
It worked after I added the
to the text and not on the html page.

thanks all for the help.

Trupti
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Ajax display issue
 
Similar Threads
Servlet+AJAX -- I am getting request.status = 404 Error
JSP Action Buttons freez after returning from ajax call
Ajax and ActionClass
Ajax question
Response from Servlet becomes null