Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Testing Servlets

 
Dick Summerfield
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm still struggling with Servlets-3a and although things are looking up at the moment I would have liked to have found some way of displaying the value of fields while testing.

In straight Java I made use of temporarily inserted System.out.println() statements to examine values. I've found that in servlets this sometimes works (Output to Orion console) but not always.

Is there a reliable way to do what I want in the case of servlets? Am I missing something really obvious here?

Dick.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dick Summerfield:

In straight Java I made use of temporarily inserted System.out.println() statements to examine values. I've found that in servlets this sometimes works (Output to Orion console) but not always.


This is typically how it's done for small projects (larger ones should have a more advanced logger, like Log4j).
I haven't used Orion in years but I remember using System.out.println and having it work consistently.
When it doesn't work, are you starting Orion differently?
 
Dick Summerfield
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:


This is typically how it's done for small projects...

I haven't used Orion in years but I remember using System.out.println and having it work consistently.
When it doesn't work, are you starting Orion differently?


Thanks for that confirmation Ben. I'm more condfident about using that technique now.

I just re-compiled and tried it again and what didn't work now does!

I always start Orion up exactly the same way so I'm now thinking that the erratic behaviour I mentioned was most likely a result of my own erratic behaviour... Perhaps forgetting to re-compile (unlikely), or forgetting to move the re-compiled stuff to "classes" (that's probably it ).

But it's nice to know println's to the Orion console should work consistently. I was afraid it might be some issue with print buffers that needed flushing or suchlike, so thanks again!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic