-
1. Re: RichFaces and url rewriting: to many sessions?
alexsmirnov Nov 12, 2008 6:07 PM (in response to asrichas2can)RichFaces push component uses as short as possible 'HEAD' requests to check server data. These requests detected by the RichFaces filter and processes without session reference. It is required by the Servlet spec to not create session without request.
There are some possible problems:
1) Web server creates session without direct reference from application. What application server do you use ?
2) You have some custom filter on front of the Richfaces filter, that creates session for an any requests. Try to change filters definition order in the web.xml ( move RichFaces filter mapping definition after all other ). It can aldo increase application performance. -
2. Re: RichFaces and url rewriting: to many sessions?
asrichas2can Nov 13, 2008 5:46 AM (in response to asrichas2can)We are using Tomcat 6.0.
The filters we use are coming from Spring, a4j is already the last one.<filter> <filter-name>RequestContextFilter</filter-name> <filter-class> org.springframework.web.filter.RequestContextFilter </filter-class> </filter> <filter> <filter-name>Acegi Filter Chain Proxy</filter-name> <filter-class> org.acegisecurity.util.FilterToBeanProxy </filter-class> <init-param> <param-name>targetClass</param-name> <param-value> org.acegisecurity.util.FilterChainProxy </param-value> </init-param> </filter> <filter> <display-name>Ajax4jsf Filter</display-name> <filter-name>ajax4jsf</filter-name> <filter-class>org.ajax4jsf.Filter</filter-class> <init-param> <param-name>createTempFiles</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>maxRequestSize</param-name> <param-value>0</param-value> </init-param> </filter>
-
3. Re: RichFaces and url rewriting: to many sessions?
ilya_shaikovsky Nov 13, 2008 6:57 AM (in response to asrichas2can)
2) You have some custom filter on front of the Richfaces filter, that creates session for an any requests. Try to change filters definition order in the web.xml ( move RichFaces filter mapping definition after all other ). It can aldo increase application performance.
As Alex mentioed - you have to defined RF filter the first in chain. -
4. Re: RichFaces and url rewriting: to many sessions?
asrichas2can Nov 13, 2008 7:54 AM (in response to asrichas2can)Thanks, but I don't understand:
Alex said:move RichFaces filter mapping definition AFTER all other
Ilya said:you have to defined RF filter the FIRST in chain.
First or last?
Or are the last filter entries the one which are used first? -
5. Re: RichFaces and url rewriting: to many sessions?
ilya_shaikovsky Nov 13, 2008 8:14 AM (in response to asrichas2can)seems Alex mistaken in word there.. There should be "move Before"
-
6. Re: RichFaces and url rewriting: to many sessions?
alexsmirnov Nov 13, 2008 12:08 PM (in response to asrichas2can)Filter definition order is not important, but mapping order is. It is defined by the <filter-mapping> element.
Sorry, i did mistake in the my answer: of course, first defined filter will be executed first. -
7. Re: RichFaces and url rewriting: to many sessions?
asrichas2can Nov 14, 2008 5:39 AM (in response to asrichas2can)Thanks for the clarification.
It seems to help, now I have only 1-3 sessions per user - instead of hundreds. That should be OK for the server runtime.
Thanks for your help!