Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing table as parameter to next page(JSTL)

 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • 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.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you talking about HTML Table?
 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Aris Doxakis
Ranch Hand
Posts: 136
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it will look like this,

request.getParameter("col1");
request.getParameter("col2");
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic