0

snippet of code defined in the controller of my application

@RequestMapping(value = "/get-data", method = RequestMethod.GET)
    public List<Chat> getAllChats(HttpServletRequest request,
            HttpServletResponse response) {
        String email = (String) request.getSession().getAttribute("email");
              ....

I am able to retrieve the email attribute and pass it into a string variable. My challenge is passing the variable from the session to a jsp file. Snippet of code of the jsp

 for (var i = 0; i < json.length; i++) {

                        theUser = email; //retrieve the email of the session here
                        theClass = json[i].user.email == theUser ? "bubbledRight" : "bubbledLeft";

How can I use the retrieved session attribute to a jsp file.

0 Answers0