public AjaxUrlInfo getAjaxUrl ( ServletContext servletContext , ServletRequest request , Object nameable ) { HttpServletRequest req = ( HttpServletRequest ) request ; // the default behavior is to set the parameter as the nameable's name or null String name = null ; if ( nameable instanceof INameable ) name = ( ( INameable ) nameable ) . getObjectName ( ) ; String path = req . getServletPath ( ) ; int idx = path . lastIndexOf ( ' ' ) ; if ( idx != - 1 ) { path = "/" + path . substring ( 1 , idx ) ; } path = req . getContextPath ( ) + path ; return new AjaxUrlInfo ( path , name ) ; }
This method will get the prefix for all URLs that are used for AJAX processing