I have a HashMap in my jsp page and i put it in the hidden field and pass it back to Controller. But when i try to cast to back to HashMap its showing some error stating that "Cannot cast from String to HashMap".
The code snippet is :
Is there a way to do this. Because its easy for me to use HashMap and i'm passing this throughout the film ticket booking cycle. Please guys help me get out of this issue.
Thanks in advance.
Never try to be a hard-worker. Be a smart-worker.
Joined: Apr 10, 2010
The method getParameter always returns a String, no way out.
If your HashMap already exists before the jsp, just put it in a request or session attribute before calling the jsp and get i back as a request or session attribute.
If you want to build a new hashmap with key-value pairs taken from input fields, you could just get them as request parameters and build the new hashmap.