How to avoid ;jsessionid=XXX on the first call to a page? it works if first page is jsp

前端 未结 3 1627
情书的邮戳
情书的邮戳 2020-12-14 19:41

I have an application which uses the welcome-page index.jsp with an the contents of the iframe is a jsf page. If I access index.js

3条回答
  •  无人及你
    2020-12-14 20:23

    Since Servlet 3.0 you could use COOKIE for this. But as JBoss 4.2.2 isn't Servlet 3.0 compilant, this isn't an option.

    Easiest would be to create a servlet filter which sends a redirect to HttpServletRequest#getRequestURI() when HttpSession#isNew() returns true. Don't forget to check the HttpServletRequest#isRequestedSessionIdFromCookie() to prevent an infinite redirect loop when the client doesn't support cookies at all.

提交回复
热议问题