com.arsdigita.web
Class RedirectSignal
java.lang.Object
java.lang.Throwable
java.lang.Error
com.arsdigita.web.TransactionSignal
com.arsdigita.web.RedirectSignal
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- LoginSignal, ReturnSignal
- public class RedirectSignal
- extends com.arsdigita.web.TransactionSignal
A signal that requests to commit or abort the current transaction
and to send a redirect to a new URL. BaseServlet traps this signal
when it is thrown and finishes the transaction before it sends the
redirect to the response. This way the client cannot see state
inconsistent with work performed in the previous request.
RedirectSignal
s are usually sent after doing work
on behalf of the user:
private final void saveUserSettings(final HttpServletRequest sreq) {
m_user.setGivenName("Gibbon");
m_user.setFamilyName("Homily");
m_user.save();
// The boolean argument true signifies that we want to commit
// the transaction.
throw new RedirectSignal(URL.here(sreq, "/user-detail.jsp"), true);
}
- Version:
- $Id: //core-platform/dev/src/com/arsdigita/web/RedirectSignal.java#8 $
- Author:
- Justin Ross <jross@redhat.com>
- See Also:
BaseServlet
,
LoginSignal
,
ReturnSignal
,
Serialized Form
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
versionId
public static final String versionId
- See Also:
- Constant Field Values
RedirectSignal
public RedirectSignal(String url,
boolean isCommitRequested)
RedirectSignal
public RedirectSignal(URL url,
boolean isCommitRequested)
getDestinationURL
public final String getDestinationURL()
isCommitRequested
public final boolean isCommitRequested()
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC