# JSP Debugging

JSP Debugging – It is always challenging task to perform debugging in any technology, Servlets are utilized to transform huge data between the client and server. While performing compilation of the code developer may get an error then sometimes it may be difficult to identify the error, at this time developer will approach a method that tracing method such as by using the System. out. println (“”), this is used to display the output.Following is the syntax to use System.out.println(“”).

System.out.println("Hi SPLessons");

Following is the simple code by using System.out.println();

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
<c:forEach var="counter" begin="1" end="10" step="1" >
<c:out value="\${counter-5}"/></br>
<% System.out.println( "counter= " +
pageContext.findAttribute("counter") ); %>
</c:forEach>
</body>
</html>

When compile the code following is the result will be generated.

-4
-3
-2
-1
0
1
2
3
4
5

The debugger is the tool which shows developer to find the ways to detect the errors such as compile time errors, run time errors, etc…. Here developer may use breakpoints and suspending threads.Following are the list of the debugging tool to debug the code.

The way of debugging the code in JSP and Servlet is same, following is the servlet debugging link.