File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Ajax to show a table with Display tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Ajax to show a table with Display tag" Watch "Ajax to show a table with Display tag" New topic
Author

Ajax to show a table with Display tag

surya naidu
Ranch Hand

Joined: Jul 26, 2010
Posts: 32
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

Joined: Oct 18, 2011
Posts: 41
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

Joined: Jul 26, 2010
Posts: 32
Well..but My Question was how do i get it on to the JSP from an AJAX call?
Sunil Sunny
Ranch Hand

Joined: Oct 18, 2011
Posts: 41
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

Joined: Jul 26, 2010
Posts: 32
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

Joined: Oct 18, 2011
Posts: 41



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

Joined: Jul 26, 2010
Posts: 32
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)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ajax to show a table with Display tag