wood burning stoves 2.0*
The moose likes Struts and the fly likes How to pass xmlresponse to another jsp in struts1.3? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to pass xmlresponse to another jsp in struts1.3?" Watch "How to pass xmlresponse to another jsp in struts1.3?" New topic
Author

How to pass xmlresponse to another jsp in struts1.3?

Simar Suvir
Greenhorn

Joined: Jul 29, 2011
Posts: 11

Hi All,

I am very new to Struts framework.We are using struts1.3 framework and also Ajax and Hibernate in our application. My query is :- There is an onclick function in one jsp upon which i pass the user input to the Ajax class,run a query and get the result set back as xmlhttp response in the jsp. Now, I need to show the result in the table of another jsp.How can I pass this xmlresponse from current jsp to another jsp?

I need help urgently.Kindly help and let me know if any queries.

Regards,
Simar
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Welcome to Javaranch !!!

Till you got result from Ajax call in jsp is fine, but where is your other jsp page, is that included in your current jsp?

Thanks,
Shailesh
Simar Suvir
Greenhorn

Joined: Jul 29, 2011
Posts: 11

I have not included any jsp in my current jsp. I was trying to map the jsp as a forward result on success in the struts-config.xml as below.


Here DataTrapHead.jsp is the current jsp where I receive the result set as XMHttp response and DataTrapRefresh.jsp is the one where I have the tables(rows) to display the data.
Kindly let me know if I am going wrong.
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
If I m correct your ajax action is "com.dolphin.struts.mainGUI.DataTrapAction" that you are calling from DataTrapHead.jsp then why you want to forward to other DataTrapRefresh.jsp? you are getting result in DataTrapHead.jsp you shoulld have table for population of that result in DataTrapHead.jsp itself. you can polpulate it using java script.
Simar Suvir
Greenhorn

Joined: Jul 29, 2011
Posts: 11

I tried even that way through javascript.Please find the code block below


The eventlist(value) function is taking a user input from onClick and then the flow happens to get the result set as XMLHttp response.

Kindly guide me through.
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Code you given is only a Ajax call. Are you getting correct result in ajax response?
If yes then take that result and populate in table through java script.
Simar Suvir
Greenhorn

Joined: Jul 29, 2011
Posts: 11

Now, how can I iterate through the response to populate my table in javascript?
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
you can search on google about population of HTML table through javascript you would get lot of help in result.
Please refer this link link

HTH
Simar Suvir
Greenhorn

Joined: Jul 29, 2011
Posts: 11


Thank you so much for the help. I could get the desired result.
 
wood burning stoves
 
subject: How to pass xmlresponse to another jsp in struts1.3?
 
Similar Threads
How to pass url to Struts1.3
convertNull in struts1.3
Struts1.3 tiles problem
session in struts1.3
dynamically checked radio button in struts1.3