ポータルのログイン ページからインデックス ページに移動すると、いくつかの事実に基づいて、ユーザーが外部にリダイレクトされる可能性がある状況が発生します。これは次のようになります。
if (!(marketVo.getAbsoluteUrl() != null && marketVo.getAbsoluteUrl().equals(absoluteUrlToRedirect))) {
logger.info("---WILL REDIRECT TO ABS URL: " + absoluteUrlToRedirect);
final FacesContext context = FacesContext.getCurrentInstance();
context.responseComplete();
try {
final HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
if (context.getViewRoot() != null) {
// this step will clear any queued events
context.getViewRoot().processDecodes(context);
}
response.sendRedirect(absoluteUrlToRedirect);
} catch (final Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
まあ、それは例外をスローします:
14:24:35,579 INFO [CmwSessionHelperBean] ---WILL REDIRECT TO ABS URL: http://hi
tachi.mygravitant.com
14:24:35,580 ERROR [STDERR] java.lang.IllegalStateException
14:24:35,582 ERROR [STDERR] at org.apache.catalina.connector.ResponseFacade.
sendRedirect(ResponseFacade.java:435)
14:24:35,590 ERROR [STDERR] at com.example.cloud.common.jsf.core.beans.Cmw
SessionHelperBean.createCmwUserSession(CmwSessionHelperBean.java:269)
この例外が発生しないようにするための提案をお願いできますか? リダイレクトは完了しましたが、この例外により、ポータルに戻ったときに正しく機能していないことに注意してください...