@@ -46,16 +46,34 @@ public class RsFailure extends RsForward {
46
46
*/
47
47
private static final long serialVersionUID = 396488574468386488L ;
48
48
49
+ /**
50
+ * Home page, by default.
51
+ */
52
+ private static final String HOME = "/" ;
53
+
49
54
/**
50
55
* Ctor.
51
56
* @param cause Cause
52
57
* @throws UnsupportedEncodingException If fails
53
58
*/
54
59
public RsFailure (final Throwable cause )
60
+ throws UnsupportedEncodingException {
61
+ this (cause , RsFailure .HOME );
62
+ }
63
+
64
+ /**
65
+ * Ctor.
66
+ * @param cause Cause
67
+ * @param loc Location to redirect to
68
+ * @throws UnsupportedEncodingException If fails
69
+ * @since 0.21
70
+ */
71
+ public RsFailure (final Throwable cause , final CharSequence loc )
55
72
throws UnsupportedEncodingException {
56
73
super (
57
74
new RsFlash (cause ),
58
- HttpURLConnection .HTTP_MOVED_PERM
75
+ HttpURLConnection .HTTP_MOVED_PERM ,
76
+ loc
59
77
);
60
78
}
61
79
@@ -65,10 +83,23 @@ public RsFailure(final Throwable cause)
65
83
* @throws UnsupportedEncodingException If fails
66
84
*/
67
85
public RsFailure (final String cause )
86
+ throws UnsupportedEncodingException {
87
+ this (cause , RsFailure .HOME );
88
+ }
89
+
90
+ /**
91
+ * Ctor.
92
+ * @param cause Cause
93
+ * @param loc Location to redirect to
94
+ * @throws UnsupportedEncodingException If fails
95
+ * @since 0.21
96
+ */
97
+ public RsFailure (final String cause , final CharSequence loc )
68
98
throws UnsupportedEncodingException {
69
99
super (
70
100
new RsFlash (cause ),
71
- HttpURLConnection .HTTP_MOVED_PERM
101
+ HttpURLConnection .HTTP_MOVED_PERM ,
102
+ loc
72
103
);
73
104
}
74
105
0 commit comments