This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Sending two files after successful login Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending two files after successful login" Watch "Sending two files after successful login" New topic
Author

Sending two files after successful login

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 732
1) On the right side of each webpage there is IFRAME:

<iframe name=loginFrame src='/servlet/User' marginwidth=0 marginheight=0 width=203 height=239 frameborder=0 scrolling=0></iframe>


This IFRAME checks wether user session set or not if set the User servlet display the "user control panel" else it display HTML content to get login/pass for signing in


2) Login servlet is doing two works:
(a) getting user/pass to verify from db
(b) request.getHeader("Referer");


The Problem Statement:
======================
If the Login servlet verifies the user then I want to redirect "TWO LINKS" i.e.
(1) /servlet/User (that contains user controlpanel) in IFRAME
(2) request.getHeader("Referer"); (I want to send back the user from where he/she came)

Thanks in anticipation



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60787
    
  65

No can do. You can only send one response, and to the window/frame/iframe that initiated the request.

Anything else you'll need to handle with javaScript on the page.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 732
Bear Bibeault wrote:No can do. You can only send one response, and to the window/frame/iframe that initiated the request.

Anything else you'll need to handle with javaScript on the page.


Thanks for your prompt reply

I tried lot of tricks but my mind stuck at this stage. Can you please give some example solution. That'll be your kind enough

Best Regards
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 732
Bear Bibeault wrote:No can do. You can only send one response, and to the window/frame/iframe that initiated the request.

Anything else you'll need to handle with javaScript on the page.

Again I did this:

but again unfortunately not worked for me and login frame displays "page not found error"

and main window remains same
--------------------------------------------------------------

(2) Another idea in my mind is to refresh the parent window.

Is that idea works? if yes then again don't know how'll I do it

Please help

Thanks & best regards
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60787
    
  65

A "page not found" means that you simply have the wrong URL. Don't give up so easily. Fix the problem rather than abandon the approach.
 
 
subject: Sending two files after successful login
 
Similar Threads
'POST'ing parameters to another JSP
request.getHeader("Referer")
Java with Java Script
Constructor Problem
Referer request without absolute path????