jQuery in Action, 2nd edition*
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
Author

Debugging in jsp

Rajendra Prakash
Ranch Hand

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

Joined: Oct 20, 2009
Posts: 19
if any error occurs in a jsp.at 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 http://java.sun.com/developer/Books/javaserverpages/ProJSP/Chap19.pdf
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

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
Greenhorn

Joined: Feb 17, 2009
Posts: 27

looks good
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
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
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

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] [Bear's FrontMan] [About Bear] [Books by Bear]
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

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: http://aspose.com/file-tools
 
subject: Debugging in jsp
 
Similar Threads
WA #1.....word association
Struts: No getter method for property name problem
creating a pop up calendar within a form
what is defalut value of Custom tag body-content
pop up page