Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error message: Cannot forward after response has been commited

 
sonia pandit
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This is the error message i get with the code above. If I use the redirect instead, i am getting a null for the request.getAttribute("selected") in the DownloadServlet. How do I do this?

Thanks,

Sonia
 
agnu sargar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello

might be you are re-forwarding a response which is already sent once(committed). you can check for null by setting an attribute with ServletContext object which will work.

Agnu.
 
sujith Acharya
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are using JSF framework, why are you going out of this framework? framework provides you the facility to seperate your business logic and navigation part. I dont think its necessary to forward the request to Servlet from a manged bean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic