私はStripesフレームワークの質問をしています。ストライプ - リダイレクト、期限切れセッション
前の注釈方法のリダイレクトページですか?以下のような
何か:
public class MyPageActionBean implements ActionBean {
private ActionBeanContext context;
public ActionBeanContext getContext() {
return context;
}
public void setContext(ActionBeanContext context) {
this.context = context;
}
@DefaultHandler
public Resolution view() {
String login =
(String)context.getRequest().getSession().getAttribute("login");
if (login==null) {
return new RedirectResolution(LoginActionBean.class);
} else {
// do you're normal stuff here
}
}
}
しかし、より完全なセキュリティソリューションを
Stripes Security Interceptorを実装するために、次のようになります。
@Before
public void test()
{
String login=(String)context.getRequest().getSession().getAttribute("login");
if (login==null)
{
Redirect...(LoginActionBean.class); // ??????
exit....(); // ??????
}
}
もちろん、独自のインターセプタを作成することもできます。http://www.stripesframework.org/display/stripes/Intercept+Execution(非常に簡単です) – Kdeveloper