我是靠谱客的博主 幸福西装,这篇文章主要介绍动态创建SpringMVC mapping,现在分享给大家,希望可以做个参考。

 通过源码发现spring mvc mappinghandler的执行过程,方向推到。需要注意,在registrymapping过后并不能直接调用改url。需要反射获取父类调用detectHandlerMethods,刷新springmvc映射。

package org.shoper.spring.map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.mvc.condition.*;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

import javax.annotation.PostConstruct;
import java.lang.reflect.InvocationTar

最后

以上就是幸福西装最近收集整理的关于动态创建SpringMVC mapping的全部内容,更多相关动态创建SpringMVC内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(94)

评论列表共有 0 条评论

立即
投稿
返回
顶部