Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Debugging in jsp

 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to debug error page in jsp
 
Praneeth Thiruveedhula
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 470
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

looks good
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic