• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Testing Servlets

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic