Examples of FormTag


Examples of org.springframework.web.servlet.tags.form.FormTag

    ServletRequestDataBinder binder = new ServletRequestDataBinder(tb, "tb");
    CustomDateEditor l = new CustomDateEditor(df, true);
    binder.registerCustomEditor(Date.class, l);
    pc.getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "tb", binder.getBindingResult());

    FormTag formTag = new FormTag() {
      @Override
      protected TagWriter createTagWriter() {
        return new TagWriter(new StringWriter());
      }
    };

    String action = "/form.html";
    String commandName = "tb";
    String name = "formName";
    String enctype = "my/enctype";
    String method = "POST";
    String onsubmit = "onsubmit";
    String onreset = "onreset";
    String cssClass = "myClass";
    String cssStyle = "myStyle";
    String acceptCharset = "iso-8859-1";

    formTag.setName(name);
    formTag.setCssClass(cssClass);
    formTag.setCssStyle(cssStyle);
    formTag.setAction(action);
    formTag.setCommandName(commandName);
    formTag.setEnctype(enctype);
    formTag.setMethod(method);
    formTag.setOnsubmit(onsubmit);
    formTag.setOnreset(onreset);
    formTag.setAcceptCharset(acceptCharset);

    formTag.setPageContext(pc);
    formTag.doStartTag();

    BindTag bindTag1 = new BindTag();
    bindTag1.setPageContext(pc);
    bindTag1.setPath("date");
    bindTag1.doStartTag();
    bindTag1.doEndTag();

    BindTag bindTag2 = new BindTag();
    bindTag2.setPageContext(pc);
    bindTag2.setPath("tb.date");
    bindTag2.doStartTag();
    bindTag2.doEndTag();

    BindTag bindTag3 = new BindTag();
    bindTag3.setPageContext(pc);
    bindTag3.setPath("tb");
    bindTag3.doStartTag();
    bindTag3.doEndTag();

    formTag.doEndTag();
  }
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.