2016-08-22 3 views

Répondre

1

Transmettez-le simplement à cette classe.

// 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());