public void testProcess() throws Exception {

    Controller c = (Controller) applicationContext.getBean("peopleController");
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setMethod("POST");
    HttpServletResponse response = new MockHttpServletResponse();

    request.addParameter("importStudents", "Import Students");

    ModelAndView mav =
        c.handleRequest((HttpServletRequest) request, (HttpServletResponse) response);
    Map m = mav.getModel();
    PeopleBacking p = (PeopleBacking) m.get("peopleBacking");

    MockPageContext ctx = new MockPageContext();
    ctx.setAttribute("peopleBacking", mav.getModel().get("peopleBacking"));
    request.setAttribute("peopleBacking", mav.getModel().get("peopleBacking"));

    List<ProcessErrors> errors =
        (List<ProcessErrors>)
            ExpressionEvaluationUtils.evaluate(
                "test", "${peopleBacking.processStudentsErrors}", List.class, ctx);

    for (ProcessErrors e : errors) {
      ctx.setAttribute("processErrors", e);
      log.debug(
          ExpressionEvaluationUtils.evaluate(
              "test", "${processErrors.message}", String.class, ctx));
    }
  }
 /**
  * Set HTML escaping for this tag, as boolean value. Overrides the default HTML escaping setting
  * for the current page.
  *
  * @see HtmlEscapeTag#setDefaultHtmlEscape
  */
 public void setHtmlEscape(String htmlEscape) throws JspException {
   this.htmlEscape =
       new Boolean(
           ExpressionEvaluationUtils.evaluateBoolean("htmlEscape", htmlEscape, pageContext));
 }
  public void testNew() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest();
    request = new MockHttpServletRequest("GET", "/workCodeForm.html");
    MockHttpServletResponse response = new MockHttpServletResponse();
    simpleDispatcherServlet.service(request, response);
    ModelAndView mv = child.handleRequest(request, response);

    Map m = mv.getModel();
    log.debug("m = " + m);
    WorkCodeFormBacking backing = (WorkCodeFormBacking) m.get("workCodeFormBacking");
    log.debug(Constants.toReflexString(backing));

    MockPageContext ctx = new MockPageContext();
    Iterator i = m.keySet().iterator();
    while (i.hasNext()) {
      String key = (String) i.next();
      ctx.setAttribute(key, m.get(key));
    }

    RequestContext r = new RequestContext(request, m);

    BindStatus b = r.getBindStatus("workCodeFormBacking.workCode.description");
    log.debug("expression = " + b.getExpression());
    log.debug("value = " + b.getValue());

    String description =
        (String)
            ExpressionEvaluationUtils.evaluate(
                "test", "${workCodeFormBacking.workCode.description}", String.class, ctx);

    // request.addParameter(name, description);
    String parttime =
        (String)
            ExpressionEvaluationUtils.evaluate(
                "test", "${workCodeFormBacking.workCode.parttime}", String.class, ctx);
    String code =
        (String)
            ExpressionEvaluationUtils.evaluate(
                "test", "${workCodeFormBacking.workCode.code}", String.class, ctx);
    String id =
        (String)
            ExpressionEvaluationUtils.evaluate(
                "test", "${workCodeFormBacking.workCode.id}", String.class, ctx);
    String save =
        (String)
            ExpressionEvaluationUtils.evaluate(
                "test", "${workCodeFormBacking.save}", String.class, ctx);

    log.debug("description = " + description);
    log.debug("parttime = " + parttime);
    log.debug("code = " + code);
    log.debug("id = " + id);
    log.debug("save = " + save);

    HashMap newMap = new HashMap();
    newMap.put(
        r.getBindStatus("workCodeFormBacking.workCode.description").getExpression(), description);
    newMap.put(r.getBindStatus("workCodeFormBacking.workCode.parttime").getExpression(), parttime);
    newMap.put(r.getBindStatus("workCodeFormBacking.workCode.code").getExpression(), code);
    newMap.put(r.getBindStatus("workCodeFormBacking.workCode.id").getExpression(), id);
    newMap.put(r.getBindStatus("workCodeFormBacking.save").getExpression(), "save");

    request = new MockHttpServletRequest("POST", "/workCodeForm.html");
    i = newMap.keySet().iterator();
    while (i.hasNext()) {
      String key = (String) i.next();
      log.debug("add parameter " + key + "  " + newMap.get(key));
      request.addParameter(key, (String) newMap.get(key));
    }
    mv = child.handleRequest(request, response);
    m = mv.getModel();
    log.debug("m = " + m);
    BeanPropertyBindingResult br =
        (BeanPropertyBindingResult)
            m.get("org.springframework.validation.BindingResult.workCodeFormBacking");
    log.debug("field errors " + br.getFieldErrorCount());
    log.debug("errors " + br.getErrorCount());
    assertTrue(br.getFieldError("workCode.code") != null);
    assertTrue(br.getFieldError("workCode.description") != null);
    backing = (WorkCodeFormBacking) m.get("workCodeFormBacking");
    log.debug(response.getErrorMessage());
    log.debug(Constants.toReflexString(backing));
    log.debug("view = " + mv.getViewName());
    assertTrue("workCodeForm".equals(mv.getViewName()));
  }