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
|  
Report Content as Inappropriate

Forward to Non wicket based jsp causes IllegalStateException

vikramjs2009@gmail.com
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)
                  {
                          e.printStackTrace();
                  }
          catch(ServletException ex)
          {
        System.out.println("ExS");  
          }
         
           
    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/Application.properties
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
java.lang.IllegalStateException
        at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:435)
        at org.apache.wicket.protocol.http.WebResponse.redirect(WebResponse.java:232)
        at org.apache.wicket.protocol.http.BufferedWebResponse.close(BufferedWebResponse.java:66)
        at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:372)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:201)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.eurekify.security.SecurityFilter.doFilterInternal(SecurityFilter.java:35)
        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.

Regards,
Vikram.
Loading...