01: /*
02: * $Id: RestartResponseException.java 459028 2006-02-06 08:35:34Z jonl $
03: * $Revision: 459028 $ $Date: 2006-02-06 09:35:34 +0100 (Mon, 06 Feb 2006) $
04: *
05: * ==============================================================================
06: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
07: * use this file except in compliance with the License. You may obtain a copy of
08: * the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations under
16: * the License.
17: */
18: package wicket;
19:
20: /**
21: * Causes wicket to interrupt current request processing and immediately respond
22: * with the specified page.
23: *
24: * @author Igor Vaynberg (ivaynberg)
25: */
26: public class RestartResponseException extends
27: AbstractRestartResponseException {
28: private static final long serialVersionUID = 1L;
29:
30: /**
31: * Redirects to the specified bookmarkable page
32: *
33: * @param pageClass
34: * class of bookmarkable page
35: */
36: public RestartResponseException(Class pageClass) {
37: RequestCycle.get().setResponsePage(pageClass);
38: }
39:
40: /**
41: * Redirects to the specified bookmarkable page with the given page
42: * parameters
43: *
44: * @param pageClass
45: * class of bookmarkable page
46: * @param params
47: * bookmarkable page parameters
48: */
49: public RestartResponseException(Class pageClass,
50: PageParameters params) {
51: RequestCycle.get().setResponsePage(pageClass, params);
52: }
53:
54: /**
55: * Redirects to the specified page
56: *
57: * @param page
58: * redirect page
59: */
60: public RestartResponseException(Page page) {
61: RequestCycle.get().setResponsePage(page);
62: }
63: }
|