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
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.
SCJP 1.5, SCEA, ICED (287,484,486)
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: file download-user authentication-window close