pajarokillo
Programmer
Why the code of the next processPreprocess method produce a IllegalStateException when it execute the method doForward?
protected boolean processPreprocess(HttpServletRequest request,HttpServletResponse response){
HttpSession session = null;
UserContainer user = null;
super.processPreprocess(request,response);
//Session Control if (!(request.getServletPath().equals("/login.do")))
session = request.getSession(false);
try{
if (session != null){
user = (UserContainer) session.getAttribute(IConstants.USER_CONTAINER_KEY);
if (user == null){
try{
doForward((moduleConfig.findForwardConfig("sessionExpired")).getPath(),request,response);
}
catch(IOException ex){
log.error("ERRORRRRRRRRRRRRRRRRRRRRRRRRRRRRRR: " + ex.getMessage());
}
catch(ServletException ex){
log.error("ERRORRRRRRRRRRRRRRRRRRRRRRRRRRRRRR: " + ex.getMessage());
}
}
}
}
finally{
session = null;
user = null;
}
return true;
}
Thus, in the struts-config.xml i have mapped like this
<global-forwards>
<forward name="sessionExpired" path="/sessionExpirada.jsp" />
</global-forwards>
protected boolean processPreprocess(HttpServletRequest request,HttpServletResponse response){
HttpSession session = null;
UserContainer user = null;
super.processPreprocess(request,response);
//Session Control if (!(request.getServletPath().equals("/login.do")))
session = request.getSession(false);
try{
if (session != null){
user = (UserContainer) session.getAttribute(IConstants.USER_CONTAINER_KEY);
if (user == null){
try{
doForward((moduleConfig.findForwardConfig("sessionExpired")).getPath(),request,response);
}
catch(IOException ex){
log.error("ERRORRRRRRRRRRRRRRRRRRRRRRRRRRRRRR: " + ex.getMessage());
}
catch(ServletException ex){
log.error("ERRORRRRRRRRRRRRRRRRRRRRRRRRRRRRRR: " + ex.getMessage());
}
}
}
}
finally{
session = null;
user = null;
}
return true;
}
Thus, in the struts-config.xml i have mapped like this
<global-forwards>
<forward name="sessionExpired" path="/sessionExpirada.jsp" />
</global-forwards>