Hi all.
I am using Tomcat 3.2.
These problems occur on Linux RedHat, Linux Suse and Winblows2000,
server-side and client-side, in all combinations, with various browsers.
All browsers have cookies on unconditionally.
Problem description:
I have an 'interceptor' servlet which looks at the incoming user-agent and
determines where the request should be passed off to.
It's a simple way of re-directing to HttpXXXServlet or WapXXXServlet, and so
on (to cater for Wap devices etc).
An example redirect path might be '/module/WapLoginServlet'.
Do I choose .forward() or .include() ??
Choosing .forward() :
If I choose to .forward(), I notice that the response to the browser always
responds in a prompt to Open/Save the file.
Of course, I just want the output rendered into the browser window.
The content is 'correct' for all application purposes.
In all other respects, the session management aspects work as expected wrt
Cookies and Session maintenance.
I am obeying the rule to not access the output stream of the response object
(to avoid an IllegalStateException - and no exception is being thrown) in
the initial servlet.
The ideal outcome is to get the response rendered to the browser.
It's as though an async call is being made back to the client because the
output stream has been prematurely closed or is otherwise unavailable.
I can't see in my own code where this might occur.
I don't .close() or .flush() at any point in the HttpServlet.service()
method invocation.
Choosing .include() :
If I choose to .include(), the Cookie/Session affinity is just not there
when we reach the destination servlet.
It's as though the cookies/session data are not being passed across to the
destination servlet.
But, the output (which in the first instance does not rely on the session
state) is correctly rendered to the browser.
Subsequent user interaction of course relies on session attributes, and so
this solution breaks at this point.
Is there something plainly obvious that I am missing ??
I want my cake and to eat it !!
Is this a tomcat-ism ?
mtia
jules