public boolean isSecure ( ) { // currently called once per request - later we might cache the result per request // and even the method lookup Object request = context . getExternalContext ( ) . getRequest ( ) ; if ( request instanceof HttpServletRequest ) { return ( ( HttpServletRequest ) request ) . isSecure ( ) ; } else { try { Method method = request . getClass ( ) . getDeclaredMethod ( "isSecure" , new Class [ 0 ] ) ; return ( Boolean ) method . invoke ( request , ( Object [ ] ) null ) ; } catch ( Exception e ) { return false ; } } }
Returns a boolean indicating whether this request was made using a secure channel such as HTTPS .