Spring Framework AbstractUrlHandlerMapping - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework AbstractUrlHandlerMapping class.

This code example shows how to use the following methods:getApplicationContext, getHandlerInternal
public class BindingBeanNameUrlHandlerMapping extends BeanNameUrlHandlerMapping { 
    private static final transient Logger LOG = LoggerFactory.getLogger(BindingBeanNameUrlHandlerMapping.class); 
 
    @Override 
    protected Object getHandlerInternal(HttpServletRequest request) throws Exception { 
        Object object = super.getHandlerInternal(request); 
 
        if (object instanceof String) { 
            String handlerName = (String) object; 
            object = getApplicationContext().getBean(handlerName); 
        } 
        if (object instanceof HandlerExecutionChain) { 
            HandlerExecutionChain handlerExecutionChain = (HandlerExecutionChain) object; 
            object = handlerExecutionChain.getHandler(); 
        } 
 
        if (object != null) { 
            // prevent CSRF attacks 
            if (object instanceof DestinationFacade) { 
                // check supported methods 
6
CodeRank
This code example shows how to use the following methods:lookupHandler
        this.catalog = catalog; 
    } 
     
    @Override 
    protected Object lookupHandler(String urlPath, HttpServletRequest request) throws Exception { 
        Object h = super.lookupHandler(urlPath, request); 
        if (h == null /*&& AdvancedDispatch.isSet(getApplicationContext())*/) { 
            //check for a workspace being specified in the request and strip it off 
            int i = urlPath.startsWith("/") ? 1 : 0; 
            int j = urlPath.indexOf("/", i); 
            if (j > i) { 
                String first = urlPath.substring(i, j); 
                String last = urlPath.substring(j); 
                 
                if (catalog.getWorkspaceByName(first) != null) { 
                     
                    //check for a layer being specified as well 
                    j = last.indexOf("/", 1); 
                    if (j != -1) { 
                        first = last.substring(1, j); 

5
CodeRank
This code example shows how to use the following methods:setOrder
	private ZuulController zuul; 
 
	private ZuulProperties properties; 
 
	@Autowired 
	public ZuulHandlerMapping(RouteLocator routeLocator, ZuulController zuul, 
			ZuulProperties properties) { 
		this.routeLocator = routeLocator; 
		this.zuul = zuul; 
		this.properties = properties; 
		setOrder(-200); 
	} 
 
	@Override 
	public void onApplicationEvent(InstanceRegisteredEvent event) { 
		registerHandlers(routeLocator.getRoutes()); 
	} 
 
	protected void registerHandlers(Map<String, String> routes) { 
		if (routes.isEmpty()) { 
4
CodeRank
This code example shows how to use the following methods:
    private BeanFactory beanFactory; 
    // for testing 
    private boolean customizedServerFactory; 
    private boolean customizedDataBinding; 
     
    public JaxWsWebServicePublisherBeanPostProcessor() throws SecurityException,  
           NoSuchMethodException, ClassNotFoundException { 
        try { 
            servletClass = ClassLoaderUtils.loadClass(CXF_SERVLET_CLASS_NAME, getClass()); 
        } catch (ClassNotFoundException e) { 
            Message message = new Message("SERVLET_CLASS_MISSING", LOG, CXF_SERVLET_CLASS_NAME); 
            LOG.severe(message.toString()); 
            throw e; 
        } 
        servletGetBusMethod = servletClass.getMethod("getBus"); 
    } 
     
    private Bus getServletBus() { 
        try { 
            if (shadowCxfServlet == null) { 
4
CodeRank
This code example shows how to use the following methods:lookupHandler
                && ( 
                        "check_authentication".equals(request.getParameter("openid.mode")) 
                        || "associate".equals(request.getParameter("openid.mode")) 
                        ) 
                ) { 
            return super.lookupHandler(urlPath, request); 
        } 
 
        return null; 
    } 
} 
4
CodeRank