• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp-servlet-jsp

 
Veeramanikandan Radhakrishnan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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...
 
Sathish Nagappan
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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!!!
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
ya that's working...

thanks a lot all...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!