My dev environment is Apache HTTP 2.2 -> Tomcat 6, Java 6
I have an HTML form posting to a servlet. The servlet receives the request, does some validation, adds some attributes to the request, and forwards to a JSP. The JSP runs in its entirety as evidenced through several System.out's littered throughout the page. The servlet stops processing as it should, as evidenced by the lack of the existence of a the result of a System.out in the servlet.
The really strange thing is, though, is that the client is left with a valid, but blank HTML page. I have no idea what is generating the blank page, but it nonetheless is what is returned to the client.
This may be more than what you want to see, but here is the code. Here is the servlet.
Any ideas are appreciated.
Bear: The forward is there and clearly explained within the all caps comments in the code I posted. The code for the proprietary routine is displayed as well. Here it is again for reference:
The comments show up green to me in the original post. I thought it would be obvious the way I noted that and hoped it would reduce the need for anyone to read all of the code. I suspect if I can get it to flow properly past the noted point of code, the other places the forward occurs will work as well.
I did not post the message twice. However, I did make an edit to the original after posting and submitted that change. Maybe that's why the post displayed twice??
A blank but valid HTML means I'm getting:
And that HTML isn't being delivered by any code I have deployed to Tomcat nor Apache. So I suspect there is some kind of default routing it is hitting or page it delivers, but have no clue since the logs are empty of anything except what I explicitly output to them.
Paul: No exceptions are being thrown unless they can be thrown with no evidence of them in any logs anywhere. Actually, as stated in the orignal post, the forward is working just fine. I see all my System.out's in the Tomcat logs, both from the servlet and from the JSP. I do not see the:
in the logs, and I wouldn't expect to.
D. Ogranos: I littered my JSP with the exact kind of code you suggested. As stated in the original post, the JSP is running all the way through (there is a System.out after the last line of it). In fact, even the attributes are being passed in the request! The JSP completes just fine, and then it goes off to the blank HTML page shown above... which BTW, exists no where in my Tomcat app or Apache pages.
There are no exceptions showing up in the logs, and no errors showing up in the logs on either the Tomcat or Apache side. I can hit the JSP page directly through the browser and it works fine, so there are no issues with the JSP page. It has to be something about the forwarding that either I'm screwing up (though it seems simple enough). I also see the request to the servlet in the Apache access logs, and it returns a clean, 200!
Just because the browser shows a blank page doesn't mean there is nothing returned, a partial page might display as blank.
Personally I am rather fond of the Firebug plugin for Firefox for study of requests and responses.
William Brogden wrote:You said a blank page - did you view source or use one of the many tools available to see the exact response content?
I'm glad you said that. I just viewed source. I used both HttpFox in FireFox, and then CURL, and both show absolutely nothing coming back. Also, FireFox's view source showed nothing, but IE's was showing the generated HTML. Therefore, the wonderful IE must be generating the HTML source I see when it gets nothing back. This make me feel just a tiny bit better, as at least I know some rogue blank HTML page isn't sitting in my server somewhere. I had combed my configs to be sure I had not accidentally (or boneheadedly) suppressed 4xx and 5xx messages.
So, the mystery still remains...here is the Apache log entry showing the hit to the servlet:
The only thing in the error.log of apache is the missing "favIcon.ico" entry.... And nothing except my System.out's from both the servlet and the JSP in tomcat logs (localhost, stdout, stderr). Nothing in mod_jk, and no errors anywhere.
Bear Bibeault wrote:Comments are not helpful. We need to see real code. Otherwise we have no way of knowing what's really executing.
I'm losing you, man! I posted the entire servlet code, and the code from the superclass that couldn't immediately be seen, so all the the code related to the problem is there. Though I did show that in comments within the code, looking back, the only thing I could have done to make it more clear was to point out to pay attention to the comments that are all caps.
the wonderful IE must be generating the HTML source
Ah yessssss the ever so helpful IE, which is why I prefer to debug with FireFox.
When you have to use IE - unset the "Show friendly HTTP error messages" option under Internet Options -> Advanced.
This will at least get you a chance of seeing the original error.
(I hate to think of the developer hours wasted by those friendly error messages)