how to avoid user from opening a new window

Hi,

I have a problem in my project. Here, when the user performs different operations in single window then every thing works fine .... but if the user opens a new window by clicking on ctrl+N or file->new Window, then a different window wil open but the session will be same. This is creating problems in the application. Please let me knwo is there any way to restrict the user from opening a new window ? please help me in this .....

[449 byte] By [vinjavaa] at [2007-11-27 11:40:03]
# 1

You can't.

Likely you application logic needs a redesign. If you elaborate the problems in detail instead of asking for workarounds, then we could try to help solving the problems.

BalusCa at 2007-7-29 17:29:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

okie .... i will tell briefly what is the problem ....

Take a scenario wherein a user has logged into my application and he is performing a task which will put his user id and his employee id into the session. Then he opens another window by using either ctrl+n or through files->new window.

So now a new browser will open but the session will be same ..... in this newly opened browser, user performs some operation which will remove the user id and employee id from the session .... Now if he again comes back to the first window and tries to do some operation, then a null pointer exception will be thrown saying that the employee id is null .... because he has deleted that in the newly created browser ..... to avoid this situation what can we do ? can you please help me in this regard ? you got my problem right !!!

vinjavaa at 2007-7-29 17:29:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Check if employeeId is null and then redirect to "You are already logged off, please login" page or so.

BalusCa at 2007-7-29 17:29:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

Like Balus is saying, you have to divorce yourself from the idea that you are in control of the flow. You have to assume that objects in your session might not be there, and if you detect a situation where objects have been removed, you have to go back to a login page or restart at the beginning. It might not seem right from your perspective, but the user can't be too surprised, as it was the user that started a new window.

I stressed about this problem in one of my first web applications, and stored information on the session and compared that to info posted from each page, but that was way more trouble than it was worth. Insure with each server invocation that everything is in an acceptable state before processing.

jackett_dada at 2007-7-29 17:29:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...