Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Simar Suvir
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Simar Suvir
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now, how can I iterate through the response to populate my table in javascript?
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thank you so much for the help. I could get the desired result.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic