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 :-)