Don't redirect by default.
Added awaitFriendlyResponse() which will throw FriendlyExceptions. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1200 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,10 +1,8 @@
|
|||||||
//
|
//
|
||||||
// $Id: ServiceWaiter.java,v 1.3 2003/08/15 02:23:47 ray Exp $
|
// $Id: ServiceWaiter.java,v 1.4 2003/08/15 03:07:52 ray Exp $
|
||||||
|
|
||||||
package com.samskivert.servlet.util;
|
package com.samskivert.servlet.util;
|
||||||
|
|
||||||
import com.samskivert.servlet.RedirectException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extends the basic ServiceWaiter to be useful for servlets.
|
* Extends the basic ServiceWaiter to be useful for servlets.
|
||||||
*/
|
*/
|
||||||
@@ -38,23 +36,14 @@ public class ServiceWaiter extends com.samskivert.util.ServiceWaiter
|
|||||||
* @return true if a success response was posted, false if a failure
|
* @return true if a success response was posted, false if a failure
|
||||||
* repsonse was posted.
|
* repsonse was posted.
|
||||||
*/
|
*/
|
||||||
public boolean awaitResponse ()
|
public boolean awaitFriendlyResponse (String friendlyText)
|
||||||
throws RedirectException
|
throws FriendlyException
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return waitForResponse();
|
return waitForResponse();
|
||||||
|
|
||||||
} catch (TimeoutException te) {
|
} catch (TimeoutException te) {
|
||||||
throw new RedirectException(getTimeoutRedirectURL());
|
throw new FriendlyException(friendlyText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the page to which we redirect on timeout.
|
|
||||||
*/
|
|
||||||
protected String getTimeoutRedirectURL ()
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
return "/";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user