[seasar-dev:848] S2Containerを利用するの件

解金松 [E-MAIL ADDRESS DELETED]
2008年 7月 8日 (火) 18:06:54 JST


S2Containerを利用する
Interceptor を作成時、DBからデータを抽出機能がある場合、Daoを利用ほしいです。
でも、取得ほしいのDAOは取得しなけど、どしようが。教えてください。
以下Interceptor クラスです。
public class LoginAuthInterceptor extends AbstractInterceptor {
 ...
public Object invoke(MethodInvocation invocation) throws Throwable {
  Object ret = null;
  if(invocation.getClass().getName().startsWith("com.teeda.web.login.LoginPage"))
return null;
  if(invocation.getClass().getName().startsWith("com.teeda.web.error.ErrorPage"))
return null;
  HttpSession session = (HttpSession)
container.getParent(0).getExternalContext().getSession();
 // 取得ほしいのDaoです、
  MessageDao dao = (MessageDao)
this.getContainer().getComponent(MessageDao.class);
  ...
}
以上、よろしくお願いします。
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: <http://ml.seasar.org/archives/seasar-dev/attachments/20080708/0edd56e4/attachment.html>


Seasar-dev メーリングリストの案内