• 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

Passing table as parameter to next page(JSTL)

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have on first page a table object with data. When this page calls another page how do I retrieve the content of this table in next page as parameters. I am using JSTL.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you talking about HTML Table?
 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. On first JSP I have a table HTML table(5 cols and 100 rows) with data.I submit this page in the next page I want to retrieve them using JSTL.
 
Sheriff
Posts: 67748
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
The only way you could do that is to send the table's data to the next page via HTML form elements.

Better yet, why not just re-create the data that you sent to the first page in order to create the table in the first place?
 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The application current architecure passes data between pages using JSTL. The objects are retrieved using JSTL ${param}. So far only HTML <form> elements are passsed on - i can access each element like ${param.cust_name}, where cust_name is a text item in the form tag on the first page. Now if I put a table in <FORM> element how will I access individual row/cols using JSTL?
 
Bear Bibeault
Sheriff
Posts: 67748
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
Again, any data you wish to pass on to the next page must be in a form element such as <input>.
 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. But How do I retrive that in JSTL.Like i have a table of 10 rows and 2 columns. Syntax to retrieve that in next page?

<table rows=10>
<td>
<input type=text name="col1">
<input type=text name="col2">
<td>
</table>

Thanks
 
Ranch Hand
Posts: 136
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it will look like this,

request.getParameter("col1");
request.getParameter("col2");
 
Bear Bibeault
Sheriff
Posts: 67748
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

Originally posted by Raj Puri:
But How do I retrive that in JSTL.



First, a terminology correction. You mean EL not JSTL.

And the answer is just like any other submitted parameter: via the param builtin variable. E.g. ${param.col1}.

I'm not sure what's confusing you here. Just because your form elements are arranged in a table in the originating HTML form makes no difference to anything, Upon submission, all request parameters just become a map of name/value pairs.
reply
    Bookmark Topic Watch Topic
  • New Topic