Java 类org.springframework.web.servlet.tags.NestedPathTag 实例源码

项目:spring4-understanding    文件:InputTagTests.java   
@Test
public void withNestedBind() throws Exception {
    NestedPathTag nestedPathTag = new NestedPathTag();
    nestedPathTag.setPath("spouse.");
    nestedPathTag.setPageContext(getPageContext());
    nestedPathTag.doStartTag();

    this.tag.setPath("name");

    assertEquals(Tag.SKIP_BODY, this.tag.doStartTag());

    String output = getOutput();
    assertTagOpened(output);
    assertTagClosed(output);

    assertContainsAttribute(output, "type", getType());
    assertValueAttribute(output, "Sally");
}
项目:class-guard    文件:InputTagTests.java   
public void testWithNestedBind() throws Exception {
    NestedPathTag nestedPathTag = new NestedPathTag();
    nestedPathTag.setPath("spouse.");
    nestedPathTag.setPageContext(getPageContext());
    nestedPathTag.doStartTag();

    this.tag.setPath("name");

    assertEquals(Tag.SKIP_BODY, this.tag.doStartTag());

    String output = getOutput();
    assertTagOpened(output);
    assertTagClosed(output);

    assertContainsAttribute(output, "type", getType());
    assertValueAttribute(output, "Sally");
}
项目:spring4-understanding    文件:InputTagTests.java   
@Test
public void withNestedBindTagWithinForm() throws Exception {
    NestedPathTag nestedPathTag = new NestedPathTag();
    nestedPathTag.setPath("spouse.");
    nestedPathTag.setPageContext(getPageContext());
    nestedPathTag.doStartTag();

    BindTag bindTag = new BindTag();
    bindTag.setPath("name");
    bindTag.setPageContext(getPageContext());
    bindTag.doStartTag();

    BindStatus bindStatus = (BindStatus) getPageContext().findAttribute(BindTag.STATUS_VARIABLE_NAME);
    assertEquals("Sally", bindStatus.getValue());
}
项目:spring4-understanding    文件:LabelTagTests.java   
@Override
protected void extendPageContext(MockPageContext pageContext) throws JspException {
    super.extendPageContext(pageContext);

    NestedPathTag nestedPathTag = new NestedPathTag();
    nestedPathTag.setPath("spouse.");
    nestedPathTag.setPageContext(pageContext);
    nestedPathTag.doStartTag();
}
项目:class-guard    文件:InputTagTests.java   
public void testWithNestedBindTagWithinForm() throws Exception {
    NestedPathTag nestedPathTag = new NestedPathTag();
    nestedPathTag.setPath("spouse.");
    nestedPathTag.setPageContext(getPageContext());
    nestedPathTag.doStartTag();

    BindTag bindTag = new BindTag();
    bindTag.setPath("name");
    bindTag.setPageContext(getPageContext());
    bindTag.doStartTag();

    BindStatus bindStatus = (BindStatus) getPageContext().findAttribute(BindTag.STATUS_VARIABLE_NAME);
    assertEquals("Sally", bindStatus.getValue());
}
项目:class-guard    文件:LabelTagTests.java   
@Override
protected void extendPageContext(MockPageContext pageContext) throws JspException {
    super.extendPageContext(pageContext);

    NestedPathTag nestedPathTag = new NestedPathTag();
    nestedPathTag.setPath("spouse.");
    nestedPathTag.setPageContext(pageContext);
    nestedPathTag.doStartTag();
}