error redirecting from one jsf to another
843844Apr 24 2007 — edited Jul 23 2009Hi,I am trying to redirect a jsf page from another JSF page. It redirects but get an illegalStateExcetion in the console. pls advise if anyone came across the similar problem..
Here is my code:
public List getSecList() {
FacesContext fc = FacesContext.getCurrentInstance();
ExternalContext context = fc.getExternalContext();
logic goes here
if(flag){
context.redirect(/faces/jsp/ErrorPage.jsp");
}
return secList; // this secList is assigned to the datatable (getSecDataTable)
}
it redirects to the error page but will get the below error in the console and it takes long time to redirect to the error page.
[4/24/07 16:22:05:462 EDT] 00000032 SystemErr R java.lang.IllegalStateException
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendRedirect(WebAppDispatcherContext.java:486)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendRedirect(SRTServletResponse.java:810)
at com.ibm.faces.context.MultipartExternalContextImpl.redirect(MultipartExternalContextImpl.java:421)
at com.keybank.tfa.pagecode.jsp.ResetPassword.getSecList(ResetPassword.java:167)
at com.keybank.tfa.pagecode.jsp.ResetPassword.getSecDataTable(ResetPassword.java:352)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:80)
at com.ibm.faces.databind.SelectItemsPropResolver.getValue(SelectItemsPropResolver.java:41)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:167)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:151)
at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:243)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:156)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:137)
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:502)