Hi,
I would appreciate it if anyone could please point out to me any development article that would help me follow best practices in logging errors on a try {} catch () {} in JSP.
Regards
Clive Stewart
Views
Replies
Total Likes
Hi Cleve
I generally use Approach 1 mentioned here: http://www.codejava.net/java-ee/jsp/how-to-handle-exceptions-in-jsp
~Dipti
Views
Replies
Total Likes
Thank you for the helpful information
Views
Replies
Total Likes
Hi Clive,
It seems like Adobe(view from outside) are moving away from jsp code with lot's of inline Java code.
Have you looked at more modern practices such as HTL's and Sling Models(look like more modern practices)?
Regards,
Peter
Views
Replies
Total Likes
Hi Peter,
Unfortunately I am working on code written by other developers. They do not want to move to HTL. So when I look through their code all try {} catch() {} code suppress all errors. E.g
try {
Some Java code to read a resource
} catch (Exception e) {}
So I must make best of it as I cannot follow the best practice, which to me is use HTL (avoid JSP) and OSGI for business logic (i.e. do not have the java code for this in a jsp) , and where JSP is used keep the java simple. If its complex place it in OSGI. If it acceses JCr and othe Db resources, place it in OSGI.
But that is not up to me, so hence I am trying to think of what is the best way in AEM with JSP.
The simplest answer is to use the available implicit object, log as follows
=> log.error("my error",e).
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies