@Override
protected String determineUrl(final FilterInvocation filterInvocation) {
HttpServletRequest request = filterInvocation.getHttpRequest();
HttpServletResponse response = filterInvocation.getHttpResponse();
GrailsWebRequest existingRequest;
try {
existingRequest = WebUtils.retrieveGrailsWebRequest();
}
catch (IllegalStateException e) {
throw new IllegalStateException(
"There was a problem retrieving the current GrailsWebRequest. This usually indicates a filter ordering " +
"issue in web.xml (the 'springSecurityFilterChain' filter-mapping element must be positioned after the " +
"'grailsWebRequest' element when using @Secured annotations) but this should be handled correctly by the " +
"webxml plugin. Ensure that the webxml plugin is installed (it should be transitively installed as a " +
"dependency of the spring-security-core plugin)");
}
String requestUrl = calculateUri(request);
String url = null;
try {
javax.servlet.ServletContext servletContext = (ServletContext)grails.util.Holders.getServletContext();
// servlet.ServletContext =
GrailsWebRequest grailsRequest = new GrailsWebRequest(request, response,servletContext );
WebUtils.storeGrailsWebRequest(grailsRequest);
Map<String, Object> savedParams = copyParams(grailsRequest);
UrlMappingInfo[] urlInfos;