Package javax.servlet.http

Examples of javax.servlet.http.HttpServletRequest


  }

  public Object getValue(ActionContext injectionContext)
  {

    HttpServletRequest request = injectionContext.getRequest();

    HttpSession session = request.getSession(false);

    if (session == null)
    {
      return null;
    }
View Full Code Here


  }

  public Object getValue(ActionContext injectionContext)
  {

    HttpServletRequest request = injectionContext.getRequest();

    HttpSession session = request.getSession(false);

    Object attribute = null;

    if (session != null)
      attribute = session.getAttribute(attributeName);

    if (attribute == null)
    {
      if (required)
      {
        throw new StaleSessionException("Attribute missing from session: " + attributeName);
      }
      if (autoCreateClass != null)
      {
        attribute = ReflectHelper.createInstance(autoCreateClass, Object.class);
        if (session == null)
        {
          session = request.getSession();
        }
        session.setAttribute(attributeName, attribute);
      }
    }
    return attribute;
View Full Code Here

  }

  public Object getValue(ActionContext injectionContext)
  {

    HttpServletRequest request = injectionContext.getRequest();

    Object attribute = request.getAttribute(attributeName);
    if (attribute == null)
    {
      HttpSession session = request.getSession();
      attribute = session.getAttribute(attributeName);
    }
    if (attribute == null)
    {
      ServletContext context = injectionContext.getContext();
View Full Code Here

public class RedirectHelperInjectionHandler implements InjectionHandler
{

  public Object getValue(ActionContext injectionContext)
  {
    HttpServletRequest request = injectionContext.getRequest();
    RedirectHelper redirectHelper = (RedirectHelper) request.getAttribute(InfrastructureKeys.REDIRECT_HELPER);

    if (redirectHelper == null)
    {
      redirectHelper = new RedirectHelperImpl();
      request.setAttribute(InfrastructureKeys.REDIRECT_HELPER, redirectHelper);
    }
    return redirectHelper;
  }
View Full Code Here

    return getMessageResources(injectionContext);
  }

  protected MessageResources getMessageResources(ActionContext injectionContext)
  {
    HttpServletRequest request = injectionContext.getRequest();

    ServletContext context = injectionContext.getContext();
    ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, context);

    // Return the requested message resources instance
View Full Code Here

    if (messageResources == null)
    {
      throw new ApplicationConfigurationException("test me");
    }

    HttpServletRequest request = injectionContext.getRequest();
    Locale locale = (Locale) request.getAttribute(Globals.LOCALE_KEY);

    return new MessageResourcesHelperImpl(locale, messageResources);

  }
View Full Code Here

  }

  public Object getValue(ActionContext injectionContext)
  {

    HttpServletRequest request = injectionContext.getRequest();

    String value = request.getParameter(parameterName);

    if (required && value == null)
    {
      throw new IllegalStateException("Request parameter " + parameterName
          + " is required but has not been supplied. This is probably a programming error");
View Full Code Here

    super();
  }

  public Object getValue(ActionContext injectionContext)
  {
    HttpServletRequest request = injectionContext.getRequest();
    return request.getAttribute(Globals.LOCALE_KEY);
  }
View Full Code Here

  }

  public Object getValue(ActionContext injectionContext)
  {

    HttpServletRequest request = injectionContext.getRequest();

    Object attribute = request.getAttribute(attributeName);

    if (attribute == null && autoCreateClass != null)
    {
      attribute = AnnotationFactoryUtils.maybeAutoCreate(autoCreateClass);
      request.setAttribute(attributeName, attribute);
    }
    return attribute;
  }
View Full Code Here

  @Test
  public void testActionLogging()
  {

    HttpServletRequest request = createMock(HttpServletRequest.class);
    ActionMapping mapping = createMock(ActionMapping.class);

    // before execute
    expect(request.getRequestURI()).andReturn("uri");
    expect(mapping.getType()).andReturn("type");

    // after execute
    expect(request.getRequestURI()).andReturn("uri");

    replay(request);
    replay(mapping);

    ActionLoggingInterceptor interceptor = new ActionLoggingInterceptor();
View Full Code Here

TOP

Related Classes of javax.servlet.http.HttpServletRequest

Copyright © 2015 www.massapicom. 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.