Package javax.servlet.http

Examples of javax.servlet.http.HttpServletRequest


  void postExecute(ActionContext context)
  {
    ServletActionContext sc = (ServletActionContext) context;
   
    final HttpServletRequest request = sc.getRequest();
    final ActionMapping actionConfig = (ActionMapping) sc.getActionConfig();
    final Boolean formValid = context.getFormValid();
   
    formValidationHandler.postValidate(request, actionConfig, formValid);
  }
View Full Code Here


  @Test
  public void testHistoryRecorderPost()
  {

    HttpServletRequest request = createMock(HttpServletRequest.class);

    expect(request.getMethod()).andReturn("POST");

    replay(request);

    HistoryRecorder interceptor = new HistoryRecorder();
    interceptor.afterExecute(null, new TestContextImpl(request, null, null, null, null), null);
View Full Code Here

  @Test
  public void testHistoryRecorderGet()
  {

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

    expect(request.getMethod()).andReturn("GET");
    expect(request.getSession()).andReturn(session);
    expect(request.getServletPath()).andReturn("path");
    expect(request.getQueryString()).andReturn("queryString");
    List<String> arrayList = new ArrayList<String>();
    expect(session.getAttribute(InfrastructureKeys.GOOD_URL_HISTORY)).andReturn(arrayList);
    arrayList.add("path?queryString");
    session.setAttribute(InfrastructureKeys.GOOD_URL_HISTORY, arrayList);
View Full Code Here

  @Test
  public void testProcessCachedMessagesNoSession() throws ServletException, IOException
  {

    HttpServletRequest request = createStrictMock(HttpServletRequest.class);

    replay(request);

    EmptyPreprocessor processor = new EmptyPreprocessor();
    processor.preprocessRequest(request);
View Full Code Here

  @Test
  public void testSessionNotPresent()
  {

    HttpServletRequest request = createMock(HttpServletRequest.class);

    expect(request.getSession(false)).andReturn(null);

    replay(request);

    RedirectBeforeInterceptor interceptor = new RedirectBeforeInterceptor();
    interceptor.beforeExecute(null, new TestContextImpl(request));
View Full Code Here

  @Test
  public void testParametersNotPresent()
  {

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

    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute(InfrastructureKeys.REDIRECT_PARAMETERS)).andReturn(null);

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

  @Test
  public void testPresent()
  {

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

    Map<String, Object> map = new HashMap<String, Object>();

    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute(InfrastructureKeys.REDIRECT_PARAMETERS)).andReturn(map);
    session.removeAttribute(InfrastructureKeys.REDIRECT_PARAMETERS);
    request.setAttribute(InfrastructureKeys.REDIRECT_PARAMETERS, map);

    replay(request);
    replay(session);

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

  @Test
  public void testProcessCachedMessagesNoSession() throws ServletException, IOException
  {
   
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);

    expect(request.getSession(false)).andReturn(null);

    replay(request);

    SessionErrorPreprocessor delegate = new SessionErrorPreprocessor();
    delegate.preprocessRequest(request);
View Full Code Here

 
  @Test
  public void testProcessCachedMessagesNoErrors() throws ServletException, IOException
  {
   
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    HttpSession session = createStrictMock(HttpSession.class);

    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute(Globals.ERROR_KEY)).andReturn(null);

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

 
  @Test
  public void testProcessCachedMessagesWithErrors() throws ServletException, IOException
  {
   
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    HttpSession session = createStrictMock(HttpSession.class);

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

    replay(request);
    replay(session);

    SessionErrorPreprocessor delegate = new SessionErrorPreprocessor();
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.