Search in sources :

Example 1 with NestedPathTag

use of org.springframework.web.servlet.tags.NestedPathTag in project spring-framework by spring-projects.

the class InputTagTests method withNestedBind.

@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");
}
Also used : NestedPathTag(org.springframework.web.servlet.tags.NestedPathTag) Test(org.junit.Test)

Example 2 with NestedPathTag

use of org.springframework.web.servlet.tags.NestedPathTag in project spring-framework by spring-projects.

the class InputTagTests method withNestedBindTagWithinForm.

@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());
}
Also used : NestedPathTag(org.springframework.web.servlet.tags.NestedPathTag) BindTag(org.springframework.web.servlet.tags.BindTag) BindStatus(org.springframework.web.servlet.support.BindStatus) Test(org.junit.Test)

Example 3 with NestedPathTag

use of org.springframework.web.servlet.tags.NestedPathTag in project spring-framework by spring-projects.

the class LabelTagTests method extendPageContext.

@Override
protected void extendPageContext(MockPageContext pageContext) throws JspException {
    super.extendPageContext(pageContext);
    NestedPathTag nestedPathTag = new NestedPathTag();
    nestedPathTag.setPath("spouse.");
    nestedPathTag.setPageContext(pageContext);
    nestedPathTag.doStartTag();
}
Also used : NestedPathTag(org.springframework.web.servlet.tags.NestedPathTag)

Aggregations

NestedPathTag (org.springframework.web.servlet.tags.NestedPathTag)3 Test (org.junit.Test)2 BindStatus (org.springframework.web.servlet.support.BindStatus)1 BindTag (org.springframework.web.servlet.tags.BindTag)1