• 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

jsp-servlet-jsp

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please help as i'm new to java server pages and servlets

how to accomplish the folowing task...

1. a java server page file must be created to select a pdf file from a browser.

2. a servlet must be coded to read the file and give it back to another jsp

3. the third java server page file must print it on the browser...
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether the page with the link is a JSP or not is irrelevant.

The link should submit to a servlet that sets the response headers as approriate and stream the PDF as its response.

No JSP page is necessary.
 
Veeramanikandan Radhakrishnan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am sorry.. i couldn't get you...

could you help me out with an example?

i will be thankful on response

thanks in advance...
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Google 'ServletOutputStream' and streaming files using the response object. You should get some good code examples, without making anyone to 're-invent the wheel' unnecessarily.
 
Veeramanikandan Radhakrishnan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey thanks all of you!!!

i am filled with joy... i am done with it...

thanks to javaranch tooo
 
Veeramanikandan Radhakrishnan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but i have another problem now...

i have to use sessions to pass a parameter from servlets to jsp...

how to do that?

help out!!!
 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I'm no expert, but maybe you need to add the parameter to the session attributes. So in your doGet/doPost...


then you could retrieve this in your jsp, using the session object

Maybe thats right?
 
Veeramanikandan Radhakrishnan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya that's working...

thanks a lot all...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic