• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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