@RequestMapping(value = {"/log"}, method=RequestMethod.POST)
    @ResponseBody
    public String login(HttpSession session, String username, String password) throws Exception {
        User u;
        List<Map<String,Object>> list=rdao.getuserdata(u);
        if(member !=null) 
        {
        session.setAttribute("MEMBER", member); 
         return "taskform";
        }
        else
        {
            throw new Exception("invalid user name or password");
        }
        return "loginup";
    }   
in above code how to set httpsession
            Asked
            
        
        
            Active
            
        
            Viewed 308 times
        
    0
            
            
         
    
    
        ravibagul91
        
- 20,072
- 5
- 36
- 59
 
    
    
        Hardik Vaghela
        
- 1
- 1
- 
                    Hey, please take a look in to this, https://stackoverflow.com/questions/33942106/how-to-manage-session-in-spring-mvc?rq=1 – Vysakhan Kasthuri May 31 '19 at 10:54
- 
                    it's not a correct Ans – Hardik Vaghela May 31 '19 at 11:12
- 
                    The link can help you to find out an answer. In you code you are setting "MEMBER" as a session attribute and providing value for that attribute. So what do you mean by 'how to set httpSession', Can you please elaborate what exactly are you trying to achieve. – Vysakhan Kasthuri May 31 '19 at 12:45
- 
                    Sir, my question is a how to get data in Dao class in declare in controller – Hardik Vaghela Jun 03 '19 at 06:57