下面列出了怎么用org.springframework.web.servlet.tags.BindTag的API类实例代码及写法,或者点击链接到github查看源代码。
@Test
public void simpleBindTagWithinForm() throws Exception {
BindTag bindTag = new BindTag();
bindTag.setPath("name");
bindTag.setPageContext(getPageContext());
bindTag.doStartTag();
BindStatus bindStatus = (BindStatus) getPageContext().findAttribute(BindTag.STATUS_VARIABLE_NAME);
assertEquals("Rob", bindStatus.getValue());
}
@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());
}
@Test
public void simpleBindTagWithinForm() throws Exception {
BindTag bindTag = new BindTag();
bindTag.setPath("name");
bindTag.setPageContext(getPageContext());
bindTag.doStartTag();
BindStatus bindStatus = (BindStatus) getPageContext().findAttribute(BindTag.STATUS_VARIABLE_NAME);
assertEquals("Rob", bindStatus.getValue());
}
@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());
}
@Test
public void simpleBindTagWithinForm() throws Exception {
BindTag bindTag = new BindTag();
bindTag.setPath("name");
bindTag.setPageContext(getPageContext());
bindTag.doStartTag();
BindStatus bindStatus = (BindStatus) getPageContext().findAttribute(BindTag.STATUS_VARIABLE_NAME);
assertEquals("Rob", bindStatus.getValue());
}
@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());
}