public boolean preHandle ( HttpServletRequest request , HttpServletResponse response , Object handler ) throws Exception { String queryString = request . getQueryString ( ) == null ? "" : request . getQueryString ( ) ; if ( ConfigurationService . getInstance ( ) . isValid ( ) || request . getServletPath ( ) . startsWith ( "/configuration" ) || request . getServletPath ( ) . startsWith ( "/resources" ) || queryString . contains ( "requestFromConfiguration=true" ) ) { return true ; } else { response . sendRedirect ( "configuration" ) ; return false ; } }
This will check to see if certain configuration values exist from the ConfigurationService If not then it redirects to the configuration screen