• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

HttpResponse headers for pdf output

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

I'm working on an app that has to write a pdf to the ServletOutputStream so it opens in the browser,
i'm fairly new to spring so I basicly have no clue on how to start on this.
I've written a controller method and set the response header to application/pdf but all it shows is a blank html page not even application/pdf in the browser's title bar.
Below you'll find the code I've written, do I have to register a bean to use the HttpServletResponse in the context file or what am I missing?

 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spring does support your controller just returning a View object, so in your case your PDF object. Try that to see if that works.

Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic