String attributeName = null; String attributeValue = null; for(int i = 0; i < getVariables().size(); i++) { attributeName = getVariables().get(i); attributeValue = matcher.group(i + 1); request.getAttributes().put(attributeName, attributeValue); }
	public void beforeHandle(Request request, Response response)	{		String remainingRef = request.getRelativePart();		Matcher matcher = getPattern().matcher(remainingRef);      boolean matched = matcher.lookingAt();               if(getLogger().isLoggable(Level.FINER))      {      	getLogger().finer("Attempting to match this pattern: " + getPattern().toString() + " >> " + matched);      }      if(matched)      {	      // Updates the context	      String matchedPart = remainingRef.substring(0, matcher.end());	      Reference baseRef = request.getBaseRef();		      if(baseRef == null)	      {	      	baseRef = new Reference(matchedPart);	      }	      else	      {	      	baseRef = new Reference(baseRef.toString(false, false) + matchedPart);	      }	      	      request.setBaseRef(baseRef);		      if(getLogger().isLoggable(Level.FINE))	      {	      	getLogger().fine("New base URI: " + request.getBaseRef());	      	getLogger().fine("New relative part: " + request.getRelativePart());	      }		      if(getLogger().isLoggable(Level.FINE))	      {	      	getLogger().fine("Delegating the call to the target Restlet");	      }	   }      else      {      	response.setStatus(Status.CLIENT_ERROR_NOT_FOUND);      }	}   