Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending map object to success view

 
indu iyengar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,

am using simple form controller and in controller i need to send a map object to success view. The view has to display all the elements of the map object in the form check boxes . please tell me how to do this ?

 
indu iyengar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my code in controller is :

code in success page is :

but ends up with the exception :

please help me how to get both keyvalue and value . any help would be highly appreciated..
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

Your error seems to be about page directives? Can you show us what page directives you have on your JSP?

Sean
 
indu iyengar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply.. am not using any page directive in jsp. But in spring config file am mentioning it as session form="true"...

in none of forms and views am using any directives, but able to get messages. Even here am getting the size of the map, but not values..

is this essential to use directives in jsp while using map ? please clarify , how can I get the values in successview ?
 
Prasad Krishnegowda
Ranch Hand
Posts: 670
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Indu,
you are able to get the size of the map, then, are you able to go inside the forEach loop? Also, what does just ${map} print in your jsp? Also, which is the 4th line in JSP, where the Exception is coming?
 
indu iyengar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys I solved that .. thanks for replying ...
actually the problem is i have not added the code in the jsp ..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic