• Post Reply Bookmark Topic Watch Topic
  • New Topic

c:forEach and form parameters  RSS feed

 
Aodhan Hoffman
Ranch Hand
Posts: 35
Java MyEclipse IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to parse incoming form intput into a table where one column prints out the name of the parameter, the other column its value. Since the request.param object is a HashMap, it should have both. Is there simply no way to do this? ( I should note that it prints out the values alone just fine. )

If it is possible, as it is in PHP, what is the field name for the parameter names? Thanks!

here's the code fragment:
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66157
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the request.param object is a HashMap


Well, it's a Map implementation; no guarentee that it will be a HashMap.

But this is your major clue (the fact that it's a Map). Since entries in a Map are returned as instances of Map.Entry, you now know enough to answer your own question.
[ May 02, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66157
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. Clicking the 'disable smilies' checkbox when you post code will make your <cut> tags look less surprised.
 
Aodhan Hoffman
Ranch Hand
Posts: 35
Java MyEclipse IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, that was the clue-by-four I was looking for. Thanks!
I didn't recognize the significance of the nested class.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66157
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the Map interface plays such a strong role in the EL/JSTL, it's a really important concept to have under your belt. Which was why I didn't just blurt out an answer.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!