Examples of HttpSession


Examples of javax.servlet.http.HttpSession

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = createMock(HttpServletRequest.class);
    HttpSession session = createNiceMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute("autoCreateSession")).andReturn(null);

    replay(request);
    replay(session);

    InjectionWrapper inputWrapper = inputs.get("autoCreateSession");
View Full Code Here

Examples of javax.servlet.http.HttpSession

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
    HttpSession session = EasyMock.createMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute("nonAutoCreateSession")).andReturn(null);

    replay(request);
    replay(session);

    InjectionWrapper inputWrapper = inputs.get("nonAutoCreateSession");
View Full Code Here

Examples of javax.servlet.http.HttpSession

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
    HttpSession session = EasyMock.createMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(null);
    expect(request.getSession()).andReturn(session);
    session.setAttribute(eq("autoCreateSession"), anyObject());

    replay(request);
    replay(session);

    InjectionWrapper inputWrapper = inputs.get("autoCreateSession");
View Full Code Here

Examples of javax.servlet.http.HttpSession

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
    HttpSession session = EasyMock.createMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute("requiredSessionAttribute")).andReturn(null);

    replay(request);
    replay(session);

    InjectionWrapper inputWrapper = inputs.get("requiredSessionAttribute");
View Full Code Here

Examples of javax.servlet.http.HttpSession

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
    HttpSession session = EasyMock.createMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute("requiredAutoCreateSessionAttribute")).andReturn(null);

    replay(request);
    replay(session);

    InjectionWrapper inputWrapper = inputs.get("requiredAutoCreateSessionAttribute");
View Full Code Here

Examples of javax.servlet.http.HttpSession

  public void testPreValidate()
  {

    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    ActionMapping mapping = createStrictMock(ActionMapping.class);
    HttpSession session = createStrictMock(HttpSession.class);

    replay(mapping);
    replay(request);
    replay(session);
View Full Code Here

Examples of javax.servlet.http.HttpSession

  @Test
  public void testPostValidateFailed()
  {

    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    HttpSession session = createStrictMock(HttpSession.class);

    final ActionErrors actionErrors = new ActionErrors();
    EasyMock.expect(request.getAttribute(Globals.ERROR_KEY)).andReturn(actionErrors);
    EasyMock.expect(request.getSession()).andReturn(session);
    session.setAttribute(Globals.ERROR_KEY, actionErrors);
   
    replay(request);
    replay(session);

    FormValidationHandlerImpl delegate = new FormValidationHandlerImpl();
View Full Code Here

Examples of javax.servlet.http.HttpSession

    NavigableLookupDispatchAction actionBean = createMock(NavigableLookupDispatchAction.class);

    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);
    HttpSession session = createMock(HttpSession.class);
    ModuleConfig moduleConfig = createMock(ModuleConfig.class);
    ActionServlet servlet = createMock(ActionServlet.class);
    ServletContext context = createMock(ServletContext.class);
    MessageResources messageResources = createMock(MessageResources.class);
    DelegatingForm form = createStrictMock(DelegatingForm.class);

    action.setServlet(servlet);

    actionBean.preBind();
    form.bindInwards(actionBean);
    expect(request.getAttribute(Globals.CANCEL_KEY)).andReturn(null);
    expect(mapping.getParameter()).andReturn("method");
    expect(request.getParameter("method")).andReturn("Insert Stuff Here");
    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute(Globals.LOCALE_KEY)).andReturn(Locale.getDefault());
    expect(request.getAttribute(Globals.MODULE_KEY)).andReturn(moduleConfig);
    expect(moduleConfig.findMessageResourcesConfigs()).andReturn(new MessageResourcesConfig[]
    {
      new MessageResourcesConfig()
    });
View Full Code Here

Examples of javax.servlet.http.HttpSession

    NavigableLookupDispatchAction actionBean = createMock(NavigableLookupDispatchAction.class);

    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);
    HttpSession session = createMock(HttpSession.class);
    ModuleConfig moduleConfig = createMock(ModuleConfig.class);
    ActionServlet servlet = createMock(ActionServlet.class);
    ServletContext context = createMock(ServletContext.class);
    MessageResources messageResources = createMock(MessageResources.class);

    action.setServlet(servlet);

    expect(request.getAttribute(Globals.CANCEL_KEY)).andReturn(null);
    expect(mapping.getParameter()).andReturn("method");
    expect(request.getParameter("method")).andReturn("Insert Stuff Here");
    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute(Globals.LOCALE_KEY)).andReturn(Locale.getDefault());
    expect(request.getAttribute(Globals.MODULE_KEY)).andReturn(moduleConfig);
    expect(moduleConfig.findMessageResourcesConfigs()).andReturn(new MessageResourcesConfig[]
    {
      new MessageResourcesConfig()
    });
View Full Code Here

Examples of javax.servlet.http.HttpSession

  @WebMethod
  @WebResult(name = "stringOut", partName = "stringOut")
  public String test1StringInStringOut(
      @WebParam(name = "string", partName = "string") String string) {
    HttpServletRequest request = (HttpServletRequest)Fiber.current().getPacket().get(MessageContext.SERVLET_REQUEST);
    HttpSession session = request.getSession(true);
    if(session != null){
      Object sessionAttr = session.getAttribute("sessionAttr");
      session.setAttribute("sessionAttr", string);
      if(sessionAttr != null){
        return sessionAttr.toString();
      }
    }
    return string;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.