Package com.gwain.authweb.servlets

Source Code of com.gwain.authweb.servlets.SendUserServlet

package com.gwain.authweb.servlets;

import com.gwain.authweb.entities.ChatUser;
import com.gwain.authweb.entities.ChatUsers;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
*
* @author
*/
public class SendUserServlet extends HttpServlet {

    private String user = "";
    private Map<String, StringBuffer> usersLog;

   

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        final ChatUser curuser = (ChatUser) req.getSession().getAttribute("curuser");
        final ChatUsers users =  (ChatUsers) getServletContext().getAttribute("users");
        ((List<String>)users.getUsers().get(curuser)).add(req.getParameter("mess"));
        resp.sendRedirect(resp.encodeRedirectURL("msg.jsp"));
    }
}
TOP

Related Classes of com.gwain.authweb.servlets.SendUserServlet

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.