Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Servlet not showing System.out.prints!??!?

Thread view: 
ron1972 - 23 Nov 2005 17:10 GMT
I've hit this forwards and backwards and can't figure this out.

I was getting all kinds of erroneous results and to eliminate the
possibilty of my Trace class having problems I resorted to using some
System.out statements.  The results were even stranger:

My session object was acting buggy in my jsp page so I decided to call
it in the servlet just to see if I was still getting errors...

private void find
{
...
ArrayList al = (ArrayList)session.getAttribute("retailLogin");
System.out.println("TEST");
System.out.println("getAttribute: " + al.size());
..
}

Here is the output:

TEST

The second line isn't printing!  In fact I've tried getting the
al.size() info through a couple of ways, neither work.

Now get this part:  This only happens the first few times I run the
app.  If I try 2 times it will start working:

TEST
AL SIZE FROM JSP: 1

the 3rd time I ran it *NONE* of the System.outs worked throughout the
entire servlet

huh?!?!
Has anyone had similar problem?  Any solutions?
Much appreciated if anyone has any advice where to even start looking
for a solution.
Thanks
abrasivesponge@gmail.com - 23 Nov 2005 18:36 GMT
Check your log....Do you have a NullPointerException anywhere in there?
ron1972 - 23 Nov 2005 20:39 GMT
Actually, I changed my submit type in the jsp file from <INPUT
type="submit" ... to a link and it works -huh?!? That's an interesting
bit of info.

<a href="javascript:findByEmail()">Email</a> - works!

<input type="submit" onClick="javascript:findByEmail()" value="Email" >
- submits but the servlet is having problems!

This doesn't make much sense because they are both calling the same
method.  And why would a submit button affect System.out.print not
printing?

hmmm..... (still working on it)
Viator - 25 Nov 2005 04:40 GMT
Your problem seems to be in your html code. Please quote the javascript
and the form tag code also.

Amit :-)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.