Hi,
I am creating a JSON output for markup exposed by my custom component. In this JSON i have 2 attributes (componentMarkup , successFlag). If there is no issue in component execution then i set the "successFlag" to TRUE else FALSE.
What is the best way to know that some exception occurred during component execution ? This will help me in setting this "successFlag" for my JSON. I want to wrap entire component JSP code around some try / catch so that if there is any exception anywhere in JSP it will set successFlag to FALSE
One way to do this using <c:catch> . Are there any other better way to do this ?
<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>