Tag handler for <when> in JSTL's expression-evaluating library.
679680681682683684685686687688689690691692
{ ChooseTag chooseTag = new ChooseTag(); JspTagLifecycle chooseLifecycle = new JspTagLifecycle(pageContext, chooseTag); WhenTag whenTag = new WhenTag(); JspTagLifecycle whenLifecycle = chooseLifecycle.addNestedTag(whenTag); whenTag.setTest("false"); whenLifecycle.expectBodySkipped(); OtherwiseTag otherwiseTag = new OtherwiseTag(); JspTagLifecycle otherwiseLifecycle = chooseLifecycle.addNestedTag(otherwiseTag);
704705706707708709710711712713714715716
* @throws IOException If the tag throws an IOException */ public void testWhenTagWithoutChooseTag() throws JspException, IOException { WhenTag tag = new WhenTag(); JspTagLifecycle lifecycle = new JspTagLifecycle(pageContext, tag); tag.setTest("true"); try { lifecycle.invoke(); fail("Expected JSPTagException"); }
652653654655656657658659660661662663664
{ ChooseTag chooseTag = new ChooseTag(); JspTagLifecycle chooseLifecycle = new JspTagLifecycle(pageContext, chooseTag); WhenTag whenTag = new WhenTag(); JspTagLifecycle whenLifecycle = chooseLifecycle.addNestedTag(whenTag); whenTag.setTest("true"); whenLifecycle.expectBodyEvaluated(); chooseLifecycle.invoke(); }
612613614615616617618619620621622623624
639640641642643644645646647648649650651652
664665666667668669670671672673674675676
613614615616617618619620621622623624625