congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SelectTag.doEndTag
Code IndexAdd Tabnine to your IDE (free)

How to use
doEndTag
method
in
org.springframework.web.servlet.tags.form.SelectTag

Best Java code snippets using org.springframework.web.servlet.tags.form.SelectTag.doEndTag (Showing top 4 results out of 315)

origin: spring-projects/spring-framework

@Test
public void withoutItems() throws Exception {
  this.tag.setItemValue("isoCode");
  this.tag.setItemLabel("name");
  this.selectTag.setPath("testBean");
  this.selectTag.doStartTag();
  int result = this.tag.doStartTag();
  assertEquals(Tag.SKIP_BODY, result);
  this.tag.doEndTag();
  this.selectTag.doEndTag();
  String output = getOutput();
  SAXReader reader = new SAXReader();
  Document document = reader.read(new StringReader(output));
  Element rootElement = document.getRootElement();
  List children = rootElement.elements();
  assertEquals("Incorrect number of children", 0, children.size());
}
origin: spring-projects/spring-framework

@Test
public void withoutItemsEnumParent() throws Exception {
  BeanWithEnum testBean = new BeanWithEnum();
  testBean.setTestEnum(TestEnum.VALUE_2);
  getPageContext().getRequest().setAttribute("testBean", testBean);
  this.selectTag.setPath("testBean.testEnum");
  this.selectTag.doStartTag();
  int result = this.tag.doStartTag();
  assertEquals(BodyTag.SKIP_BODY, result);
  result = this.tag.doEndTag();
  assertEquals(Tag.EVAL_PAGE, result);
  this.selectTag.doEndTag();
  String output = getWriter().toString();
  SAXReader reader = new SAXReader();
  Document document = reader.read(new StringReader(output));
  Element rootElement = document.getRootElement();
  assertEquals(2, rootElement.elements().size());
  Node value1 = rootElement.selectSingleNode("option[@value = 'VALUE_1']");
  Node value2 = rootElement.selectSingleNode("option[@value = 'VALUE_2']");
  assertEquals("TestEnum: VALUE_1", value1.getText());
  assertEquals("TestEnum: VALUE_2", value2.getText());
  assertEquals(value2, rootElement.selectSingleNode("option[@selected]"));
}
origin: spring-projects/spring-framework

@Test
public void withoutItemsEnumParentWithExplicitLabelsAndValues() throws Exception {
  BeanWithEnum testBean = new BeanWithEnum();
  testBean.setTestEnum(TestEnum.VALUE_2);
  getPageContext().getRequest().setAttribute("testBean", testBean);
  this.selectTag.setPath("testBean.testEnum");
  this.tag.setItemLabel("enumLabel");
  this.tag.setItemValue("enumValue");
  this.selectTag.doStartTag();
  int result = this.tag.doStartTag();
  assertEquals(BodyTag.SKIP_BODY, result);
  result = this.tag.doEndTag();
  assertEquals(Tag.EVAL_PAGE, result);
  this.selectTag.doEndTag();
  String output = getWriter().toString();
  SAXReader reader = new SAXReader();
  Document document = reader.read(new StringReader(output));
  Element rootElement = document.getRootElement();
  assertEquals(2, rootElement.elements().size());
  Node value1 = rootElement.selectSingleNode("option[@value = 'Value: VALUE_1']");
  Node value2 = rootElement.selectSingleNode("option[@value = 'Value: VALUE_2']");
  assertEquals("Label: VALUE_1", value1.getText());
  assertEquals("Label: VALUE_2", value2.getText());
  assertEquals(value2, rootElement.selectSingleNode("option[@selected]"));
}
origin: spring-projects/spring-framework

@Test
public void withNestedOptions() throws Exception {
  this.tag.setPath("country");
  int result = this.tag.doStartTag();
  assertEquals(Tag.EVAL_BODY_INCLUDE, result);
  BindStatus value = (BindStatus) getPageContext().getAttribute(SelectTag.LIST_VALUE_PAGE_ATTRIBUTE);
  assertEquals("Selected country not exposed in page context", "UK", value.getValue());
  result = this.tag.doEndTag();
  assertEquals(Tag.EVAL_PAGE, result);
  this.tag.doFinally();
  String output = getOutput();
  assertTrue(output.startsWith("<select "));
  assertTrue(output.endsWith("</select>"));
  assertContainsAttribute(output, "name", "country");
}
org.springframework.web.servlet.tags.formSelectTagdoEndTag

Javadoc

Closes any block tag that might have been opened when using nested OptionTag.

Popular methods of SelectTag

  • getItems
    Get the value of the ' items' attribute.May be a runtime expression.
  • forceMultiple
    Returns ' true' if the bound value requires the resultant ' select' tag to be multi-select.
  • getBindStatus
  • getItemLabel
    Get the value of the ' itemLabel' attribute.May be a runtime expression.
  • getItemValue
    Get the value of the ' itemValue' attribute.May be a runtime expression.
  • getMultiple
    Get the value of the HTML ' multiple' attribute rendered on the final ' select' element.
  • getName
  • getSize
    Get the value of the ' size' attribute.
  • isHtmlEscape
  • processFieldValue
  • writeDefaultAttributes
  • doFinally
    Clears the TagWriter that might have been left over when using nested OptionTag.
  • writeDefaultAttributes,
  • doFinally,
  • evaluate,
  • getDisplayString,
  • isMultiple,
  • typeRequiresMultiple,
  • writeHiddenTagIfNecessary,
  • <init>,
  • doStartTag

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • Menu (java.awt)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • String (java.lang)
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Collectors (java.util.stream)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now