YouTip LogoYouTip

Jstl Core Catch Tag

# Tag [![Image 3: JSP Standard Tag Library](#)JSP Standard Tag Library](#) The tag is primarily used to handle exceptional situations that produce errors and to store the error message. ### Syntax Format <c:catch var=""> ... ### Attributes The tag has the following attributes: | Attribute | Description | Required | Default Value | | --- | --- | --- | --- | | var | Variable to store the error message | No | None | * * * ## Example c:catch Tag Example

Exception: ${catchException}
Exception occurred: ${catchException.message}

The result of running the above example: Exception: java.lang.ArithmeticException: / by zero Exception occurred: / by zero * * JSP Standard Tag Library](#)
← Jstl Core If TagJstl Core Remove Tag β†’