<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> <head> <title>c:remove Tag Example</title> </head> <body> <c:set var="salary" scope="session" value="${100000}"/> <p>Before Remove Value: <c:out value="${salary}"/></p> <c:remove var="salary"/> <p>After Remove Value: <c:out value="${salary}"/></p> <c:catch var ="catchException"> <% int x = 5/0;%> </c:catch> <c:if test = "${catchException != null}"> <p>The exception is : ${catchException} <br /> There is an exception: ${catchException.message}</p> </c:if> </body> </html>
As you can see above, we are trying to display result of dividing firstNumber with secondNumber. It may be possible that secondNumber is 0. In that event, exception will be thrown at run time. <c:catch> block will handle this exception and print the exception in the next <c:if> block.
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…