List of usage examples for org.apache.wicket.request.http WebRequest getClientUrl
public abstract Url getClientUrl();
From source file:org.wicketstuff.rest.resource.AbstractRestResource.java
License:Apache License
/** * Throw an exception if two o more methods have the same "score" for the current request. See * method selectMostSuitedMethod.// www. j a v a2s . c o m * * @param list * the list of ambiguous methods. */ private void throwAmbiguousMethodsException(ScoreMethodAndExtractPathVars... methods) { WebRequest request = getCurrentWebRequest(); String methodsNames = ""; for (ScoreMethodAndExtractPathVars method : methods) { if (!methodsNames.isEmpty()) methodsNames += ", "; MethodMappingInfo urlMappingInfo = method.getMethodInfo(); methodsNames += urlMappingInfo.getMethod().getName(); } throw new WicketRuntimeException("Ambiguous methods mapped for the current request: URL '" + request.getClientUrl() + "', HTTP method " + HttpUtils.getHttpMethod(request) + ". " + "Mapped methods: " + methodsNames); }