I have the below jsp file in which there is a java code inside the scriplet. Within that scriplet i want to comment a piece of code , which I have commented in the below way as shown. In the updated code also at the end I have added a comment mentioning the bug no., now can you please advise whether this is the correct way to comment in JSP?
<%
try {
String FunctionName = "abc_message";
//c = eBean.getByID(Integer.parseInt(abcId));
c = eBean.getByID(Long.parseLong(abcId)); // BugId:29
}
catch (Exception e) {
e.printStackTrace();
}
%>
It is not advised to keep commented out code in java class. JSP will be converted to java class only. You can add comments to make your code readable and understandable but commented out code should not be there. You can use version control tool like SVN/Git, if you want to keep track of bugs or any changes and to have versions of your code.