Mapping key and values, adding message in Java
<p>I have a question about mapping, map key and map values.</p>

<p>I am writing a chat program : I have a problem to add a message. I can't add a message.  That puts me in a empty web page with an error(can't see the number and reason of error)</p>

<p>Can you tell me where is the problem ?</p>

<pre><code>// add a message to a chatroom
@RequestMapping(value="/addMessageSalon/{salon}/{pseudo}/{message}", method = {RequestMethod.GET, RequestMethod.POST})
public String addMessageSalon(HttpServletRequest request, @PathVariable("salon") String chatroom, @PathVariable("pseudo") String username, @PathVariable("message") String message) {

    Message mes = null;      
    mes.setMessage(message);      
    mes.setPseudo(username);

    GestionMessages addition = (GestionMessages)request.getSession().getServletContext().getAttribute("gestionMessages");

    Map&lt;String, ArrayList&lt;Message&gt;&gt; resultat = addition.getMessages();

    Iterator&lt;Map.Entry&lt;String, ArrayList&lt;Message&gt;&gt;&gt; entries = resultat.entrySet().iterator();        

    // iteration
    while(entries.hasNext()) {

        Map.Entry&lt;String, ArrayList&lt;Message&gt;&gt; entry = entries.next();

        if(!entries.hasNext() &amp;&amp; !entry.getKey().contains(chatroom)) {

            // if chatroom does not exist, we give an error
            throw new IllegalArgumentException("Chatroom '" + chatroom + "' doesn't exist");        
        }

        if(entry.getKey().contains(chatroom)){     
            ControleurPrincipal.getUsersInDataBase().add(username);                 
            addition.getMessagesSalon(chatroom).add(mes);                
            break;                              
        }                 
    }

    resultat = addition.getMessages();
    return "redirect:/";
}
</code></pre>