• Post Reply Bookmark Topic Watch Topic
  • New Topic

What would be the best tool to debug servlet/jsp??

 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im not sure if this is the right forum, but I was wondering what tools are best suited to debug servlet/jsp. At the moment Im simply adding print statement throughout... I tried to intergrate Tomcat with VAJ 4.0 but I cant get it to work. As anyone got combined VAJ with Tomcat 4.x???
Is there an IDE that I can download for free or relatively cheap that I can place breakpoints to step through my serlet/jsp ?
Can someone please help, point me in the right direction.
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this thread should be moved to the Tomcat forum.
There is a tomcat debugger as eclipse plugin. I will post later where you find it. I haven't checked it yet.
There is a tomcat debugger in WSAD. Also a Websphere debugger.
If you just want logging, because debuggers are too slow:
- Log4J is pretty cool. Much better than:
- servlet.log statements combined with having current log file open in textpad (textpad.org).
Axel
[ October 18, 2002: Message edited by: Axel Janssen ]
 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you could provide the appropriate links that would be great!! My God the time you would save me.
Thank you
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best debugging tool for servlet/jsp is the programmer's brain. (sorry, I just had to say that - one of these days I will finish my article of servlet debugging for the newsletter, really I will, Sheriff - stop looking at me like that.)
Ahem - anyway here are some the point that will end up in this future article:
1. The servlet/JSP environment is horrible for debugging because so many things can go wrong, and you may have multiple threads. Therefore, test as much as you can outside the servlet JSP environment. This means that as little code as possible should be in a servlet class. JavaBeans are your friends.
2. Make good use of exceptions - NEVER do a catch(Exception e){} - you are throwing away information. No reason not to invent your own Exception that carries information specific to your application.
3. Double-check the actual content being sent in a request by snooping on the request/response text. I can point you to a utility for this.
Bill
 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Double-check the actual content being sent in a request by snooping on the request/response text. I can point you to a utility for this.

Can you expand on this
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John, here is the link:
http://www.sysdeo.com/eclipse/tomcatPlugin.html
But don't expect a clean debugger. As I have said: I haven't checked it yet. You seem to need some workarounds. Check their website.
The debugger of WSAD I used sometimes is very slow. Especially for EJBs. You know that you get WSAD from IBM? There should be a test-version. Don't ask me where. I have business partner version.
My experiences point in the same direction as what Bill said above. I have made very good experience with first developing some beans and business objects, which I test/debug outside of Tomcat and later call from servlets/jsps.
Following this process you get truly layered design. Otherwise at least I very easily end up with code without clean separation of Web-UI code, business logic and database access. Perhaps its the coffee.
Axel
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page to download UtilSnoop
That page if for my SOAP book but it also works for browsers. Essentially a GUI based utility that sits between a HTTP client and a server and captures the traffic in both directions. It has a cool feature by which you can modify a request and send it again.
Other people have made similar utilities but I don't have the URLs.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!