Simplifying <c:catch> from taglib testcase
This commit is contained in:
parent
07423d92e2
commit
4282d92f30
|
@ -127,9 +127,8 @@ public class JstlTest
|
|||
SimpleRequest req = new SimpleRequest(baseUri);
|
||||
String resp = req.getString("/catch-taglib.jsp");
|
||||
System.out.println("resp = " + resp);
|
||||
assertThat("Response should be JSP processed", resp, not(containsString("<c:catch")));
|
||||
assertThat("Response should be JSP processed", resp, not(containsString("<jtest:errortest")));
|
||||
assertThat("Response", resp, containsString("[jtest:errorhandler] exception : "));
|
||||
assertThat("Response", resp, containsString("[jtest:errorhandler] exception.message : "));
|
||||
assertThat("Response should be JSP processed", resp, not(containsString("<c:catch>")));
|
||||
assertThat("Response should be JSP processed", resp, not(containsString("<jtest:errorhandler>")));
|
||||
assertThat("Response", resp, not(containsString("[jtest:errorhandler] exception is null")));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,11 +9,6 @@
|
|||
<short-name>jtest</short-name>
|
||||
<uri>org.eclipse.jetty.jstl.jtest</uri>
|
||||
|
||||
<tag-file>
|
||||
<name>errortest</name>
|
||||
<path>/META-INF/tags/errortest.tag</path>
|
||||
</tag-file>
|
||||
|
||||
<tag-file>
|
||||
<name>errorhandler</name>
|
||||
<path>/META-INF/tags/errorhandler.tag</path>
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
|
||||
<c:catch var="error">
|
||||
<c:catch var="tossable">
|
||||
<jsp:doBody />
|
||||
</c:catch>
|
||||
|
||||
<c:if test="${error != null}">
|
||||
[jtest:errorhandler] exception : ${error}
|
||||
[jtest:errorhandler] exception.message : ${error.message}
|
||||
<c:if test="${tossable != null}">
|
||||
[jtest:errorhandler] exception : ${tossable}
|
||||
[jtest:errorhandler] exception.message : ${tossable.message}
|
||||
</c:if>
|
||||
<c:if test="${error == null}">
|
||||
<c:if test="${tossable == null}">
|
||||
[jtest:errorhandler] exception is null
|
||||
</c:if>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
|
||||
<c:out value="content from jtest:errortest tag"/>
|
|
@ -4,8 +4,8 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
Title: JSTL c:catch test
|
||||
|
||||
<jtest:errortest>
|
||||
<jtest:errorhandler>
|
||||
<fmt:parseNumber var="parsedNum" value="aaa" />
|
||||
</jtest:errortest>
|
||||
</jtest:errorhandler>
|
||||
|
||||
parsedNum = <c:out value="${parsedNum}"/>
|
Loading…
Reference in New Issue