File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Debugging in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Debugging in jsp" Watch "Debugging in jsp" New topic

Debugging in jsp

Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
How to debug error page in jsp
Praneeth Thiruveedhula

Joined: Oct 20, 2009
Posts: 19
if any error occurs in a that time you can display proper error jsp page by using the page directive isErrorPage attribute.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Take a look
Pat Farrell

Joined: Aug 11, 2007
Posts: 4659

It depends on how you are developing your code. If you are using a modern IDE, they have support.

Years ago, Netbeans had it and Eclipse did not, which drove me to use NetBeans. But I'm considering going to Eclipse as NetBeans is not getting a lot of support, and I expect that Oracle won't help that, if Oracle actually can buy Sun before Sun goes away.
nand rai

Joined: Feb 17, 2009
Posts: 27

looks good
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 423
Rajendra Prakash wrote:How to debug error page in jsp

Put all your JSP code in a try/catch block.

write this before any jsp code: <% try { %>
then you write this in the end of your code <% } catch(Exception e) { e.printStackTrace(); } %>
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63867

Leandro Coutinho wrote:Put all your JSP code in a try/catch block.

Or join the 21st century and stop putting code in JSP pages.

[Asking smart questions] [About Bear] [Books by Bear]
Deepak Bala

Joined: Feb 24, 2006
Posts: 6662

Scriptless JSPs are the way to go. If you want to look at the stack trace you can always propogate the exception to the container and let the container log the trace. As for handling the error, you can set up error pages in web.xml.

Eclipse supports JSP debugging and I use it every now and then. Exploded deployments are also your friend

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
I agree. Here's the link:
subject: Debugging in jsp
It's not a secret anymore!