• 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 retrieve data from included jsp to parent jsp

 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have included couple of jsps inside my parent jsp by using jsp:include tags which opens up some templates for the customer based on his category
Now in my parent jsp I have submit button upon clicking of I should get the data from all the input fields of my included jsp
Can any one give me idea/snippet to start with



Thanks in advance :roll:
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regardless of whether the JSPs are included or not, it all ends up as one big HTML page sent to the browser. You can create one big form, or get Javascript involved.

And, since this is a client-side operation, moving to the HTML/Javascript forum.
[ September 29, 2004: Message edited by: Bear Bibeault ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To add to what Bear said, wrap the whole page in a form tag, then all of the included forms will be submitted. This is assuming that the includes do not have form tags themselves.

Eric
 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I few more doubts
1 what if included jsp contains form tag also
2. Can included jsp have same name of input fields as that of a prent jsp

Thanks again :roll:
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it has a form tag then you are going to have a harder time.

You can use JavaScript to find all of the form fields and populate other form fields and submit this new collection.

If the fields have the same name, then they will be return as an array of values.

Eric
reply
    Bookmark Topic Watch Topic
  • New Topic