answered
2014-10-27 17:03:05 +0800
gargamel25 41 ● 2 What I understood....
It's only deprecated, so you can still use it.
It's not a best practice, because if you create another thread from it(a new modal window for example) the thread serving your request will be blocked until you close the modal window.
Now knowing the default maxThreads value for tomcat 6 is 200
See : tomcat.apache.org/tomcat-6.0-doc/config/executor.html
you can see how fast 200 users who keep a opened modal window can make the server not utilizable anymore, so it won't accept any new request.
If you use disable-event-thread = false
you can have the following command:
@Command
public void advancedSearch() {
Window win = (Window)Executions.createComponents("/pages/new_account.zul", null, null);
win.doModal();
this.newAccount = (Account) win.getAttribute("account");
}
The current thread obtained from the server thread pool is blocked until you fill all the data needed for new account. So request thread is waiting at this line win.doModal().
If you have worked with swing for example, you know it's a practice there to create modals this way, but there's only one user using the app. In a web application you should not block the request until user fills a form...
If you use
disable-event-thread = true which is the default, the code will be executed right away, but win.getAttribute("account") will always return null. So you need to find another solution to get the result obtained after the modal window closes.
Hope this helps.
Why do you have to turn it on? Everything can be created in order to avoid that, so if you have problems somewhere I can try to assist you there.
chillworld ( 2014-06-30 07:21:34 +0800 )edit