aspose file tools*
The moose likes Cattle Drive and the fly likes Testing Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Testing Servlets" Watch "Testing Servlets" New topic
Author

Testing Servlets

Dick Summerfield
Ranch Hand

Joined: Oct 04, 2007
Posts: 90
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

Joined: Dec 11, 2004
Posts: 13410

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?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Dick Summerfield
Ranch Hand

Joined: Oct 04, 2007
Posts: 90
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Testing Servlets