Hi,
I am facing the same problem, and am
interested to implement your solution. Can you please share your code?
Many thanks
Yee
From: Vesa Lindfors
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, 9 November 2005
4:47 PM
To: MyFaces
Discussion; [EMAIL PROTECTED]
Subject: Re: Handling multiple
concurrent submits
I solved the doubleclick
issues with servlet-filter:
Filter sets the session-wide flag and requested URL at the begin of each
request and clears them at the end.
If second request is coming during the previous one is in execution, the filter
is doing redirect with few seconds delay to originally requested page (in case
not IE) or HttpServletResponse.SC_NO_CONTENT (in case of IE). I tried some
other headers but didn't succeed, so thats why using redirect like
httpResp.setHeader( "Refresh", "3; URL="" mySession.getAttribute("SEMAPHORE_REQUESTED_URI"));
I'm not sure if this is best approach, but it has worked for us.
--- VLi ---
On 11/9/05, Martin
Marinschek <[EMAIL PROTECTED]>
wrote:
You'll need to synchronize access to your session objects - there
really is not much way around it.
Alternative is to have everything client side, then you don't have any
problems on the server.
Except the performance, of course ;)
regards,
Martin
On 11/9/05, Simon Kitching <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I've noticed that if I click multiple times on a component that does a
> submit then quite often I get an exception generated in the server.
>
> The most obvious case for me is a table with a sortable header; if I
> pretend to be impatient and click several times on the sort header then
> usually I end up with an exception page.
>
> I believe the cause is that the browser has submitted several concurrent
> post requests to the server; multiple threads within the server then try
> to run the view at the same time, and as view components are not
> threadsafe all sorts of nasty side-effects occur. An example of a
> non-threadsafe component is a UIData with session scope; it's got only
> one rowIndex, so multiple threads trying to iterate over the rows in the
> table is bound to result in something unpleasant.
>
> How do people handle this? I can't force my users to go on a training
> course about waiting for a page to complete before clicking again. And I
> can't live with exception pages being rendered to them if they click too
> quick.
>
> Thanks,
>
> Simon
>
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces
|
- RE: Handling multiple concurrent submits Yee CN
-