I'm quit a Newbie in Servlets, so gimme some slack please.
I created a new servlet to download a pdf-file from a unix-server and display it in an iFrame. The servlet gets called, downloads the pdf, throws away the session parameters and then... starts over again. The session parameters aren't there anymore and the servlet returns an error. The strangest thing is, in our development environment the thing works. In our testing environment, it executes twice, so I'm thinking of a difference in the configuration, but I haven't got a clue where to look anymore...
This is what I see in my logging
What differences are there between dev and test?
If you use the browser dev tools to monitor the browser requests, does it actually send two requests?
How about the server request logs?
Does it do that in Dev?
If it isn't the browser, then what else might do it? Clustering setup? Load balancing? Anything like that set up in the test environment that isn't in dev?
During the transfer of the pdf-file, I wrote twice into the response-outputstream.
The odd thing is, in the development area this caused the pdf sometimes to appear a second time in the next refreshed frame, once you clicked away from the iFrame-page, in our testing-environment, it caused the doGet to be executed twice...
Thanks for the help provided. In the end, it was some stupid coding-error, but glad a colleague found it.
- X 2
Vitaliy Gaydarenko wrote:Oh... doGet(), doPost() it is deprecated. This technology use in 2000-2002 years.
Start learning something new..., as Spring MVS - modern and not,so hard in learning .
Whether it's Spring MVC (sic), Struts, JSF, whatever, the foundations of all the J2EE/JEE web applications are servlets. Even JSPs compile down into servlets.
So if you want to use a "modern framework" without the faintest clue of how things work, by all means, skip understanding servlets and their methods.
However, if you're using JSF and you come to the JSF forum for assistance in getting a JSF webapp to output a PDF, I'm going to advise you to NOT use JSF and use a raw servlet (or JSP) for that part of the app, since JSF is an HTML MVC framework and not a document-producing framework.
Just because something's been around a while doesn't mean it's useless.
Tim Holloway wrote:Just because something's been around a while doesn't mean it's useless.
Yes, you must understand how it work.
I said, that you should not use this in real project.