I'd like to base this question on the basis of the response posted by @Greg Kopff here
Basically, what I'm trying to do is to DUMP the contents of the Map returned by request.getParameterMap() method to the output.
I'm getting the following weird Map as output(the values of which I believe are the addresses of the object references of either String or String arrays)
{submit=[Ljava.lang.String;@1fe4169, color=[Ljava.lang.String;@178920a, chek_games=[Ljava.lang.String;@bbfa5c, foo=[Ljava.lang.String;@131de9b}
I have tried the following code -
public class CoffeeSelect extends HttpServlet { protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Map requestParams = req.getParameterMap(); resp.getWriter().println(requestParams); } }
The following is my HTML <form>
<form action="SelectCofee.Do" method="post"> <select id="coffe_color" name="color"> <option value="green">Green</option> <option value="red">Red</option> <option value="blue">Blue</option> </select> <br/><br/> <input type="checkbox" id="chek_games" name="chek_games" value="chess" /> <input type="checkbox" id="chek_games" name="chek_games" value="badminton" /> <input type="checkbox" id="chek_games" name="chek_games" value="cricket" /> <input type="hidden" id="foo" name="foo" value="bar" /> <input type="submit" name="submit" value="Submit" /> </form>
How to deference those object references or let me put it this way; Am I missing something here?