Code example for AbstractHandlerMapping

0
import javax.servlet.http.HttpServletRequest; 
 
import org.riotfamily.pages.model.Site; 
import org.springframework.web.servlet.handler.AbstractHandlerMapping; 
 
public class NoSiteHandlerMapping extends AbstractHandlerMapping { 
 
	private Object siteNotFoundHandler; 
 
	public void setSiteNotFoundHandler(Object siteNotFoundHandler) { 
		this.siteNotFoundHandler = siteNotFoundHandler; 
	} 
	 
	@Override 
	protected Object getHandlerInternal(HttpServletRequest request) 
			throws Exception { 
		 
		Site site = PageResolver.getSite(request); 
		if (site == null) { 
			return siteNotFoundHandler;