Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.IllegalStateException:Cannot call sendRedirect() after the response has been committed

 
Deniz Kilic
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,i am beginner in JSF. I had this exception " java.lang.IllegalStateException:Cannot call sendRedirect() after the response has been committed" and i could not solve this. Also i searched it in other web pages. But i had not clear solution. Does somebody know the clear solution? Thanks for any help.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18162
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot sendRedirect() after ANY data has been written to the HTTP response stream. This is not a JSF limitation - it's a fundamental restriction in HTTP. And by ANY output, I mean things like the content-type header, cookies, or anything else, not just page content.
 
udaykiran pulipati
Greenhorn
Posts: 12
Hibernate Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Previously I got this error

To get rid of this use below code when you redirect the page

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18162
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks like user-defined login code. I have a standard disclaimer for user-created security systems: the technical term for such things is "hacked". Or "pWned". User-designed security systems are notoriously insecure. I recommend using the J2EE standard security system instead. It has proven security, it's already installed in even the most basic J2EE servers (such as Tomcat), it's well-documented, it's already debugged, and it doesn't require special code to do most of its functions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic