Forward to Non wicket based jsp causes IllegalStateException

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Forward to Non wicket based jsp causes IllegalStateException
Hi Team,

Our Application is using Wicket1.3.6 and we wish to redirect to  our Errorlogin.jsp page which displays error.
our code is deployed on JBOSS server.

Flow of Application is :

Login page ---> wicket Login.class(Wicket Based) ---->  SecurityServiceImpl.class (Java Based)---> Forward to error jsp page(Non wicket based) on validation fail.

With-in  SecurityServiceImpl.class the code we use to Forward is .

 HttpServletResponse response1 =  ((WebRequestCycle)RequestCycle.get()).getWebResponse().getHttpServletResponse();
 HttpServletRequest request1 = ((WebRequestCycle)RequestCycle.get()).getWebRequest().getHttpServletRequest();
        RequestDispatcher rd = request1.getRequestDispatcher(url);
        System.out.println("GOING TO Forward");
        rd.forward(request1, response1);

          catch(IOException e)
          catch(ServletException ex)
    System.out.println("Executing after redirection");
    Cache cache = cacheManager.getCache("AuthenticatedUsers");
        Element element = cache.get(username);

The error  logs is :

2011-09-08 04:42:57,139 INFO  [org.apache.wicket.resource.PropertiesFactory] Loading properties files from jar:file:/D:/Program%20Files/CA/RCM/Server/eurekify-jboss/server/eurekify/deploy/eurekify.war/WEB-INF/lib/wicket-1.3.6.jar!/org/apache/wicket/
2011-09-08 04:43:05,749 INFO  [STDOUT] Condition 2 :......
2011-09-08 04:43:05,749 INFO  [STDOUT]  query stringnull
2011-09-08 04:43:05,749 INFO  [STDOUT] pathinfonull
2011-09-08 04:43:05,749 INFO  [STDOUT] requesturi/eurekify/portal/
2011-09-08 04:43:05,749 INFO  [STDOUT] GOING TO Forward
2011-09-08 04:43:05,749 INFO  [STDOUT] Executing after redirection
2011-09-08 04:43:05,749 INFO  [com/eurekify/security/SecurityServiceImpl] Using manager login to resolve user DN first
2011-09-08 04:43:05,749 INFO  [com/eurekify/security/SecurityServiceImpl] Search filter is...
2011-09-08 04:43:05,765 INFO  [com/eurekify/security/SecurityServiceImpl] Found user DN is .....
2011-09-08 04:43:05,780 ERROR [org.apache.wicket.protocol.http.WebResponse] Unable to redirect to: home?pageId=HomePage, HTTP Response has already been committed.
2011-09-08 04:43:05,780 ERROR [org.apache.wicket.protocol.http.WicketFilter] closing the buffer error
        at org.apache.catalina.connector.ResponseFacade.sendRedirect(
        at org.apache.wicket.protocol.http.WebResponse.redirect(
        at org.apache.wicket.protocol.http.BufferedWebResponse.close(
        at org.apache.wicket.protocol.http.WicketFilter.doGet(
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
        at org.springframewor


We are able to forward to non-wicket based JSP page but it produces exception in the logs, we require solution suggestion which redirect/forward to the customize page but without producing  any  exception in logs.

Team please suggest some solution.