Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JasperReports in webapp (JSF2)  RSS feed

 
Marcos Vidolin
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Guys I need your help once again. =]
I'm trying show a PDF file (using JasperReport) on browser, but it's not working... I have no errors on glassfish's log.
The code was execute completely, but just don't show the report.
That's my code:



Thank you
 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF is designed to output HTML pages. It automatically supplies a number of things that collide with non-HTML outputs like PDFs and Excel spreadsheets.

Because of that, it's better to do your PDF creation in a plain old servlet and not in JSF.
 
Marcos Vidolin
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim Holloway,

I was calling the method using a RichFaces's menu. To resolve that issue I call that same method in a <h:commandLink>, and it's working fine.
* The PDF file it's not showed in the browser but at least I can download it.
I guess something don't work in a ajax request, then if I make a JSP as you said, its will work fine too.

Thank you once again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!