aspose file tools*
The moose likes JSF and the fly likes Is any way We can tell JSF to not response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Is any way We can tell JSF to not response" Watch "Is any way We can tell JSF to not response" New topic
Author

Is any way We can tell JSF to not response

Sajan Patel
Ranch Hand

Joined: Oct 25, 2004
Posts: 77
Dear All,

I am trying to show PDF file from JSF. For that I wanted to open new window and show display through servlet (Not through JSF) but I could not open new window from JSF (You can see thread windows.open()). I would like to give response back in same page through using response.getOutPutStream() but here after this JSF is trying to give response back also and I am getting response is already commited error. If somehow I am able to config in faces-config that

so JSF will not response back and I dont get any Error.

Thanks in Advance
Sajan Patel
[ August 24, 2005: Message edited by: Sajan Patel ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I am curious as to why you are trying to mix JSF with Servlets. Why don't you just deliver the PDF using JSF? Or is this some service you are trying to attach to?


GenRocket - Experts at Building Test Data
Sajan Patel
Ranch Hand

Joined: Oct 25, 2004
Posts: 77
Thanks for reply
I would like to use more and more JSF but as I am using JSF first time and I am not sure how could I do that in JSF. I am useing iText to generate PDF (fyi: This is not PDF Form. It is just simple PDF document for printing purpose).

If I want to response back with PDF I have to get hold on response.getOutPutStream() and stream out whole PDF in outputtream.

please Let me know how if I can do that in JSF.

Thanks
Sajan Patel
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Maybe try something like this:



Just call this method using method binding on either a commandButton or commandLink.
Sajan Patel
Ranch Hand

Joined: Oct 25, 2004
Posts: 77
thanks buddy I dont know why your code is working and below my code was not working



fyi: I have used action in commandLink.

Again Thanks

Sajan Patel
[ August 24, 2005: Message edited by: Sajan Patel ]
Dippy Kar
Greenhorn

Joined: Jan 02, 2006
Posts: 1
Hi,
I faced the same problem so I am posting a reply on top of the message.
I am openning a pop up and passing a parameter. Everything is working fine but "Response already commited" and Strict servlet api--(some exception) is thrown in the console.
Can you help me out please
Sajan Patel
Ranch Hand

Joined: Oct 25, 2004
Posts: 77
Actually I am not sure what is happeing in JSF but when we are using INLINE than our document will open in same window and at that time we are having reponse commited error. But if we use ATTACHMENT than our document will open in another window (with associate application e.g. acrobat reader) and we will not have response commited error.

try with this


[ January 05, 2006: Message edited by: Sajan Patel ]
[ January 05, 2006: Message edited by: Sajan Patel ]
joe henry
Greenhorn

Joined: Jan 29, 2006
Posts: 1
Hi,
This is henry.Iam trying to print a pdf document from a jsf page.There is a PRINT command button in my screen.When i click the print button a pdf will be generated and stored in the filesystem.The generated pdf has to be printed automatically without opening the document.Just the printdialog has to be opened and the user can say print.The problem here is,there is one action event(Print button) which will generate the pdf and opens the printdialog for printing the generated pdf.Iam struckup with getting the generated pdf in my jsf and printing it.can u help me on these?

you can reach me at henry.joseph@gmail.com

Thanks
henry
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is any way We can tell JSF to not response