2016-08-22 5 views

답변

1

해당 클래스로 전달하십시오.

// The class that use the session 
public class UsingSession { 
    private HttpSession session; 

    public UsingSession(HttpSession session) { 
     this.session = session; 
    } 

    .... 
} 


// In your servlet 

... 
UsingSession x = new UsingSession(httpServletRequest.getSession());