jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piran Montford <pir...@gmail.com>
Subject Re: Session Limit Exceeded
Date Fri, 18 Feb 2005 17:01:51 GMT
I have a ATG Dynamo module that I uses Cactus, see fuller details
at:http://www.onwhichsubject.com/DynaCactus/

To get round the session limit, I extended SevletTestRedirector, as
seen below. Setting setAutomaticSessions wont work for Dynamo, as it
requires sessions, and will just ignore the setting.

Share and Enjoy, Piran.

public class DynamoServletTestRedirector extends ServletTestRedirector {

    public void doGet(HttpServletRequest pRequest, HttpServletResponse
pResponse)
            throws ServletException {
        super.doGet(pRequest, pResponse);
        
        invalidateSession(pRequest);
    }
    
    public void doPost(HttpServletRequest pRequest,
HttpServletResponse pResponse)
            throws ServletException {
        super.doPost(pRequest, pResponse);
        
        invalidateSession(pRequest);
    }
    
    private void invalidateSession(HttpServletRequest pRequest) {
        HttpSession session = pRequest.getSession(false);
        if (session != null) {
            session.invalidate();
        }
    }
}

BCNU, Piran.

Mime
View raw message