Servlet with 2 simultaneous redirects

  • Thread starter Kelly Gallagher
  • Start date
K

Kelly Gallagher

Hello all,
I have searched numerous groups via Google newsgroups
but either have not searched on the correct criteria or
I am missing something :)

My colleague's situation is this: She has one login jsp
which directs control to a single servlet. If the
servlet processes the login data correctly, she needs
to both a) close the original login browser window, and
b) bring up a static html document (which is actually
a winzip file) within a new browser window.
If the servlet processes the login info and gets an error,
she needs to preserve the login window (and of course
the login and password information) and display the
error message without opening up the html document.

She is using struts and can bring up the needed html
document with no problem upon success,
but is having problems closing the original login
jsp after (or before) re-directing the user to the static
html help document (which makes sense given the re-direct
logic). We've tried a few things which
did not work out, so I am wondering; is there a way
to create a thread within the action servlet in which one thread
would re-direct the user to the static html help page,
and another thread could send a request attribute to the previous
login page that could be resolved within the original login page to
force
it to close via javascript.

I've asked her if she can put some
javascript onto her static help html page but she said
the powers that be say no.

I am no expert at java so my questions may cause humor, but
I can take a few ribbings:) If anyone has any ideas I would
be most thankful. I dont' have her code on hand but could
get it if needed. TIA very much for any assistance. If my
question is not clear enough please feel free to post questions
and I will get clarification from my friend.
Thanks again all,

Kelly Gallagher
(e-mail address removed)
 
W

William Brogden

Hello all,
I have searched numerous groups via Google newsgroups
but either have not searched on the correct criteria or
I am missing something :)

My colleague's situation is this: She has one login jsp
which directs control to a single servlet. If the
servlet processes the login data correctly, she needs
to both a) close the original login browser window, and
b) bring up a static html document (which is actually
a winzip file) within a new browser window.
If the servlet processes the login info and gets an error,
she needs to preserve the login window (and of course
the login and password information) and display the
error message without opening up the html document.

The only way you can control a browser window is on the
browser side - this means JavaScript.
Why does the window have to close? Why can't the
HTML document replace the login screen?

She is using struts and can bring up the needed html
document with no problem upon success,
but is having problems closing the original login
jsp after (or before) re-directing the user to the static
html help document (which makes sense given the re-direct
logic).

Conceptual error - you don't "close" a jsp, a jsp just
writes a response.
We've tried a few things which
did not work out, so I am wondering; is there a way
to create a thread within the action servlet in which one thread
would re-direct the user to the static html help page,
and another thread could send a request attribute to the previous
login page that could be resolved within the original login page to
force
it to close via javascript.

No - the response can either redirect OR go to the original
window. However, you could send Javascript to the original
window that opens the new window directed at the static HTML.

Bill
http://www.wbrogden.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top