• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with Filter

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writting a filter to always redirect to a particular page but any time i access it i always get this error************************************************************************


java.lang.IllegalStateException: Cannot create a session after the response has been committed

************************************************************************

And the code segment is found below
************************************************************************




[BPSouther: Added code tags]
[ August 29, 2007: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use UBB code tags when posting code. Please read this for more information.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Abiodun Adisa:

hresponse.sendRedirect("/index.faces");
filterChain.doFilter(request, response);

Either do s redirect or continue the filter chain. It makes no sense to do both, and will usually cause problems (as you well know).
 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Please use UBB code tags when posting code. Please read this for more information.


Thanks for the UBB Tags Information, I never knew such features existed, would be sure to use them next time
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!