Package javax.faces.application

Examples of javax.faces.application.ViewExpiredException


            ExceptionQueuedEvent event = i.next();
            ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();

            Throwable t = context.getException();
            if (t instanceof ViewExpiredException) {
                ViewExpiredException vee = (ViewExpiredException) t;
                FacesContext facesContext = FacesContext.getCurrentInstance();
                Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
                NavigationHandler navigationHandler = facesContext.getApplication().getNavigationHandler();
                try {
                    // Push some useful stuff to the request scope for use in the page
                    requestMap.put("currentViewId", vee.getViewId());
                    navigationHandler.handleNavigation(facesContext, null, "/viewExpired");
                    facesContext.renderResponse();
                } finally {
                    i.remove();
                }
View Full Code Here


                log.trace("Request is a postback");

            viewRoot = viewHandler.restoreView(facesContext, viewId);
            if (viewRoot == null)
            {
                throw new ViewExpiredException("The expected view was not returned " + "for the view identifier: "
                        + viewId, viewId);
            }
            restoreViewSupport.processComponentBinding(facesContext, viewRoot);
        }
        else
View Full Code Here

                    viewRoot = viewHandler.createView(facesContext, viewId);
                    facesContext.renderResponse();

                } else {
                    Object[] params = {viewId};
                    throw new ViewExpiredException(
                          MessageUtils.getExceptionMessageString(
                                MessageUtils.RESTORE_VIEW_ERROR_MESSAGE_ID,
                                params),
                          viewId);
                }
View Full Code Here

            viewRoot = viewHandler.restoreView(context, viewId);
            if (null != viewRoot) {
               processBindings(context, viewRoot);
            } else {
               // Error restore view. Session Expired ?
               throw new ViewExpiredException("Error restore view " + viewId + ", session expired?");
            }
         } else {
            viewRoot = viewHandler.createView(context, viewId);
            context.renderResponse();
         }
View Full Code Here

   @Test
   public void testThrowViewExpired() throws Exception {
      selenium.open("http://localhost:8080/portal/portal/default/JSFIntegrationTestPortlet");
      try{
         throw new ViewExpiredException();
      }catch(ViewExpiredException vee){
         //swallow and render error page
      }
      selenium.waitForPageToLoad("30000");
      verifyTrue(selenium.isTextPresent("Error Page"));
View Full Code Here

            viewRoot = viewHandler.restoreView(context, viewId);
            if (null != viewRoot) {
               processBindings(context, viewRoot);
            } else {
               // Error restore view. Session Expired ?
               throw new ViewExpiredException("Error restore view " + viewId + ", session expired?");
            }
         } else {
            viewRoot = viewHandler.createView(context, viewId);
            context.renderResponse();
         }
View Full Code Here

                        viewRoot = viewHandler.createView(facesContext, viewId);
                        facesContext.renderResponse();

                    } else {
                        Object[] params = {viewId};
                        throw new ViewExpiredException(
                                MessageUtils.getExceptionMessageString(
                                MessageUtils.RESTORE_VIEW_ERROR_MESSAGE_ID,
                                params),
                                viewId);
                    }
View Full Code Here

                log.trace("Request is a postback");

            viewRoot = viewHandler.restoreView(facesContext, viewId);
            if (viewRoot == null)
            {
                throw new ViewExpiredException(
                    "No saved view state could be found for the view identifier: "
                        + viewId, viewId);
            }
            restoreViewSupport.processComponentBinding(facesContext, viewRoot);
        }
View Full Code Here

                viewRoot = viewHandler.restoreView(facesContext, viewId);
                if (viewRoot == null)
                {
                    // If the return from ViewHandler.restoreView() is null, throw a ViewExpiredException with an
                    // appropriate error message.
                    throw new ViewExpiredException("No saved view state could be found for the view identifier: " + viewId,
                        viewId);
                }
               
                // Store the restored UIViewRoot in the FacesContext.
                facesContext.setViewRoot(viewRoot);
View Full Code Here

                    //break;
                }
            }
            if (!isMacEqual)
            {
                throw new ViewExpiredException();
            }
           
            return cipher.doFinal(secure, 0, secure.length-macLenght);
        }
        catch (Exception e)
View Full Code Here

TOP

Related Classes of javax.faces.application.ViewExpiredException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.