Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file download-user authentication-window close

 
Ma Di
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm involved a project to let staff to access valuable files
throught intranet. I want to realize the following functions:
1. When the user clicks the zipfile download image in a html page, a user authentication window appears to ask user to enter
userid&passwd. I write the required zipfile name as a hidden
field in the authentication page.
2. Next, after entering the userid&passwd, the user clcik the
"submit" button in the user authentication page. The download
servlet then check the validity of the userid&passwd. If it's
a valid user, the download servlet sends user the required file.
I use res.redirect(zipfile) to send user zipfile.
3. After the user receives the zip file, close the authentication
window which asks userid &passwd
My problem is I don't know how to and when to close the authentication. Because after the download servlet redirect the
zipfile to the user, it can't receive request from user browser
any longer.
Can you tell me how to refine and realize the download-authentication-window close process?
Thanks a lot in advance.
Rgds,
Ma Di
 
Anil Vupputuri
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yeah, once u say response.redirect(zipfile) u cant access the request from browser unless u use other alternatives like
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(zipfile);
dispatcher.include(request, response);
(Used for including the content generated by another server resource in the body of a response)
[or]
dispatcher.forward(request, response);
(Used for forwarding a request from this servlet to another resource on the server.)

In both ways u can get request object back.
Anil.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic