??????????Junit In Action??????cactus??jetty?????м??????????????????????????????????в????????????????ü???С???????????cactus??1.8.1?????????????????2????

???????????servlet??

package junitbook.container;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class SampleServlet extends HttpServlet
{
    public boolean isAuthenticated(HttpServletRequest request)
    {
        HttpSession session = request.getSession(false);

        if (session == null)
        {
            return false;
        }
      
        String authenticationAttribute =
            (String) session.getAttribute("authenticated");
          
        return Boolean.valueOf(
            authenticationAttribute).booleanValue();
    }
}