0

How to realize a Scope "desktop" with Spring - i.e. for shared controllers

asked 2009-02-13 01:26:16 +0800

robertpic71 gravatar image robertpic71
1275 1

updated 2009-02-13 01:42:05 +0800

Sometimes it would be usefull to have a scope "desktop" for spring-injection.

I want a shared controller for 2 windows (the 2nd win is detail)- so i can not use "prototype". It work's with "session", but this could be danger when the user is working with a multitab-browser. A scope "desktop" would be nice.

But i'm not a Spring expert. Maybe someone has an idea or some code...plz

/Robert

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2009-02-13 03:32:07 +0800

hu97224 gravatar image hu97224
90 1

why is dangerous to use session in a multi-tab browser?

link publish delete flag offensive edit

answered 2009-02-17 17:11:26 +0800

robertpic71 gravatar image robertpic71
1275 1

updated 2009-02-18 00:49:53 +0800

>> why is dangerous to use session in a multi-tab browser?
problem 1
the controller/composer holds references to gui-elements, the second tab will crash, because the gui-elements belong to another desktop

problem 2
- if you storing i.e. a header field like an order (A) in the session data and the user enter new positions.
- after a telephoncall the user open a new tab and do some work for another order - the session data hold's now another order (B)
- the user continues his work on tab1 and enter new positions on order A/B?

One part that make ZK easy is the scope desktop/page. No headache about threadsafe or not threadsafe controllers - you doing a webapplication but do not share i.e. a servlet for all users.

Of course it is not a problem to avoid the scope "session" with ZK. But a Springscope "desktop" would be a nice feature to share data,

/Robert

link publish delete flag offensive edit

answered 2009-02-18 00:30:10 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Robert,

The "desktop" scope is under implementation in "ZK Spring Integration" library. We will also introduce "page", "idspace", "execution" scope, too. We hope that we can make it out at Q2, 2009.

link publish delete flag offensive edit

answered 2009-02-18 00:58:07 +0800

robertpic71 gravatar image robertpic71
1275 1

Henri,

thanks - that sounds good.

/Robert

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-02-13 01:26:16 +0800

Seen: 574 times

Last updated: Feb 18 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More