Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ajax to show a table with Display tag

 
surya naidu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a Struts 1.2 projectas a part of it,
I am working on a JSP from which i am making an AJAX call,I have a huge amount of data returned from the call,Which i want to display in a table using Display tag
In what format do i return data from the Servlet(AJAX call)?
Can anyone direct me on how to do this.


Thank you



 
Sunil Sunny
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
surya naidu wrote:I am working on a Struts 1.2 projectas a part of it,
I am working on a JSP from which i am making an AJAX call,I have a huge amount of data returned from the call,Which i want to display in a table using Display tag
In what format do i return data from the Servlet(AJAX call)?
Can anyone direct me on how to do this.


Thank you





You must return data in the form of a List or collection. Simply read this http://www.displaytag.org/1.2/tut_sources.html
 
surya naidu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well..but My Question was how do i get it on to the JSP from an AJAX call?
 
Sunil Sunny
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
surya naidu wrote:Well..but My Question was how do i get it on to the JSP from an AJAX call?


Ok sorry for misunderstanding . Well i do not know much about struts 1.2 but i know struts 2.0 . First the url which are using via get or post in ajax might be "something.do" in this "something.do" you must be forwarding to another jsp page in which you have to display the table.

as in ajax you will be executing the action. and as action will be forwarded to the jsp (what you have mapped in struts.xml). So indirectly you will be getting that jsp as response from your ajax request.


what i wrote, i had done that via struts 2.

 
surya naidu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sunil Sunny wrote:
surya naidu wrote:Well..but My Question was how do i get it on to the JSP from an AJAX call?


So indirectly you will be getting that jsp as response from your ajax request.






Well,How can I write a Table with display tag to the response stream?
 
Sunil Sunny
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Well,How can I write a Table with display tag to the response stream?

I think i am not getting you . what you are trying to do exactly ? please explain it clearly.
 
surya naidu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK

I am making an AJAX call from a JSP,which would fetch me large amount of data
I want to put this data in a table using display tag


For say I have all the data i want to show in the servlet (after making the AJAX call),
Now i got to put this data on to the JSP,How do i do it???
(Please note it is an AJAX call)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic