Pergunta

I have a big Seam project and want to serve some XML or binary data without any JSF actions or interference.

So I decided to use servlets. The method I used is described here: http://www.seamframework.org/Documentation/ReplacingServletsWithSeamResources

Actually, I'm working with two servlets providing different information.

What I want to implement now is that I can track every session using the session-id. But: Everytime the servlet is called, I get a new session-id.

In one forum they write that I have to implement a session-tracker (https://community.jboss.org/thread/190326). That means:

a) after the first call I have to send the session-id back to the client

b) after that, at every call the client has to send the session-id to the server.

c) Now the server can get the session from the session tracker.

Is there no easier solution? I mean, there should be any possibility that the Seam-servlet detects automatically that the call came from the same client as before.

Thanks!

Foi útil?

Solução

Are these requests coming from a modern web browser, or some standalone client? Is the JSESSIONID cookie being reused on subsequent requests?

If you think the cookie should be there, you can use HttpServletReqeust.getCookies() to see if the server is seeing it.

http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getCookies()

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top