File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Tools to track errors in jsp pages. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Tools to track errors in jsp pages." Watch "Tools to track errors in jsp pages." New topic
Author

Tools to track errors in jsp pages.

lokesh reddy
Ranch Hand

Joined: Sep 15, 2000
Posts: 66
Hi,
Can any one tell about the tools for debugging jsp pages. Its very hard to track the errors, that i found in jsp.
Bye.
Loke.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Yes, the JSP environment is hard to debug in.
Your most important tool is Java's exception mechanism.
In your <%@ page declaration, establish an errorPage
In your errorPage jsp, you can extract useful information - example in my Servlets and JSP book - this is part of an error page that does special treatment of a NumberFormatException
<%@ page language="java" isErrorPage="true" %>
<% if( exception instanceof NumberFormatException ){
%> Only numeric characters may be entered.<br>
<% } else { %>
<%= exception %>
<% } %>
More advice: design your JSP to make maximum use of Java beans or other components that can be tested separately.
Bill

------------------
author of:
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
I agree with Bill.
I can only say that I work with IBM's Visual Age For Java 3.5 and that it has a "JSP Execution Monitor".
It lets you see three things at the same time: The source code of the JSP, the corresponding Java code generated from the JSP into a Servlet, and the HTML generated on the fly to be sent to to the HTTP client (browser).
It's not a panacea (I know!) but it's better than nothing...

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
lokesh reddy
Ranch Hand

Joined: Sep 15, 2000
Posts: 66
Thanx Alicea and William.
Your suggestions are working out for me.
Bye.
Loke.

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
I wrote a simple monitor that intercepts and displays the request and response for servlets and JSP debugging. You can find it and the text of the debugging chapter at:
http://www.lanw.com/books/servletJSP/
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tools to track errors in jsp pages.