In my web application I have to give this line to check whether an object has a field
<c:catch var="itemException">${item.masterOrderId}</c:catch>
However, it seems like when there is an exception thrown, the page works like desired, but when there currency item has a field masterOrderId then the page get a line of ugly output of all the master order id, like this
7876288237088001859330060608701482416601260870751365393358087099973546544808785323837468560876664746049371087079881351783808767780494694690870295666366152083001
When i try to check the page source, interestingly I cannot find the string. so please let me know anything I can do to find out the trick, so I can do something to avoid of the nasty output.
Thank you.
Actually, just looking again at your question:
In my web application I have to give this line to check whether an object has a field
If you have this as a line in your JSP, if the c:catch tag isn’t getting an exception, it’s executing the EL tag and printing out the ID to the page. Instead you should catch the ID at the point that it will be used. For example:
That way if there is an exception the row gets surpressed, if not the ID gets outputted in an appropriate place.