aspose file tools*
The moose likes JSF and the fly likes XHTML file throws illegalstate exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "XHTML file throws illegalstate exception" Watch "XHTML file throws illegalstate exception" New topic
Author

XHTML file throws illegalstate exception

Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

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
SCJP | SCWCD | OCA
Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

Any Suggestions..
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16140
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XHTML file throws illegalstate exception