public boolean isJspPage ( String uri ) throws JasperException { init ( ) ; if ( jspProperties == null ) { return false ; } String uriPath = null ; int index = uri . lastIndexOf ( ' ' ) ; if ( index >= 0 ) { uriPath = uri . substring ( 0 , index + 1 ) ; } String uriExtension = null ; index = uri . lastIndexOf ( ' ' ) ; if ( index >= 0 ) { uriExtension = uri . substring ( index + 1 ) ; } for ( JspPropertyGroup jpg : jspProperties ) { JspProperty jp = jpg . getJspProperty ( ) ; String extension = jpg . getExtension ( ) ; String path = jpg . getPath ( ) ; if ( extension == null ) { if ( uri . equals ( path ) ) { // There is an exact match return true ; } } else { if ( ( path == null || path . equals ( uriPath ) ) && ( extension . equals ( "*" ) || extension . equals ( uriExtension ) ) ) { // Matches *, *.ext, /p/*, or /p/*.ext return true ; } } } return false ; }
To find out if an uri matches an url pattern in jsp config . If so then the uri is a JSP page . This is used primarily for jspc .