David, thanks for the tip.
I just tried the jsessionid approach with the browser by turning cookies off on Firefox and it works fine.
I displayed a few values from the request object using the browswer and requesting from a
java program using the java.net package classes.
From broswer with url rewritting:
httpReq.getSession(true).getId()--> 349057FA3C750BCCF0A0F2593E599A09
httpReq.getRequestedSessionId()--> 349057FA3C750BCCF0A0F2593E599A09
httpReq.isRequestedSessionIdFromCookie()--> false
httpReq.isRequestedSessionIdFromURL()--> true
httpReq.isRequestedSessionIdValid()--> true
From server with url rewritting:
httpReq.getSession(true).getId()--> AEB0FCB972D438BFD88153A484BA5214 (this one is the new session created; it ignored my jsessionid parameter.)
httpReq.getRequestedSessionId()--> null
httpReq.isRequestedSessionIdFromCookie()--> false
httpReq.isRequestedSessionIdFromURL()--> false
httpReq.isRequestedSessionIdValid()--> false
One thing I just noticed is that I have a request parameter in the url before the jsessionid parameter as described below:
http://localhost:8080/easydoc/rest/doc/20013699/page/1?easyDoc_proxyKey=FDB7566E4A3097E95F7B6C723CB9E6B0;jsessionid=FDB7566E4A3097E95F7B6C723CB9E6B0
When I inspect the value of the easyDoc_proxyKey parameter, it includes the ;jessionid as well. It is as if the ";jsessionid=xxx" is considered part of the first parameter.
Any other suggestions are welcome. I wonder what it is in a request from the browswer that allows the server to recognize the existing session and that is not working in this scenario.