• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How can i read Serealized objects stream and pdf file stream simuntaneously in one servletconnection

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an applet which is communicating with the servlet .I have used the concept of serealization.Now my servlet is configure to read the contents as below




protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
try {
response.setContentType("application/x-java-serialized-object");
PrintWriter out = null;


InputStream in = request.getInputStream();
ObjectInputStream inputFromApplet = new ObjectInputStream(in);
.................
....................



Now to read pdf file from the servlet how can i set
response.setContentType("application/pdf");


So that it would work fine for both the serealized objects and pdf file.


i had used Jeditorpane previously,but it didint open pdf file.I searched on Java ranch and others sources all were saying that jeditorpane doenst support pdf file,we have to design parser for that.


Actually i have made an web based application which at front end uses applet and back end uses servlet.Now i want to provide help file in my project,as most application have.Help file, i have made in acrobat reader.Now i want to put one help file on server so that each client can get it at runtime(it would load at their machine from server).how can i do that?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A servlet response can only contain a single type - you can't send both a serialized object and a PDF.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic