Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XHTML file throws illegalstate exception

 
Ashwin Sridhar
Ranch Hand
Posts: 277
Flex Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have just started to learn JSF using JSF Complete reference. I created a XHTML and tried to run it on server. Instead of browser displaying the contents of the XHTML, it downloads the XHTML file.

I get a IllegalStateException stating "Cannot create a session after the response has been committed".

Please let me know what I am missing here. Also let me know if there is any other better book to refer for JSF.

Regards.
Ashwin
 
Ashwin Sridhar
Ranch Hand
Posts: 277
Flex Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any Suggestions..
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ashwin Sridhar wrote:Any Suggestions..


http://www.coderanch.com/how-to/java/PatienceIsAVirtue

I can almost guarantee that you are attempting to seize the HttpServletResponse stream from JSF and add your own headers and/or content. You should never do that.

If you are attempting to generate non-HTML response such as a PDF or a Microsoft Office document, use a servlet or (non-JSF) JSP to do that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic