随笔-13  评论-9  文章-9  trackbacks-0

DispatcherServlet
1。初始化默认配置
 private static final String DEFAULT_STRATEGIES_PATH = "DispatcherServlet.properties";

static {
  // Load default strategy implementations from properties file.
  // This is currently strictly internal and not meant to be customized
  // by application developers.
  try {
   ClassPathResource resource = new ClassPathResource(DEFAULT_STRATEGIES_PATH, DispatcherServlet.class);
   InputStream is = resource.getInputStream();
   try {
    defaultStrategies.load(is);
   }
   finally {
    is.close();
   }
  }
  catch (IOException ex) {
   throw new IllegalStateException("Could not load 'DispatcherServlet.properties': " + ex.getMessage());
  }
 }

DispatcherServlet.properties 里面内容为:
org.springframework.web.servlet.LocaleResolver=org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver

org.springframework.web.servlet.ThemeResolver=org.springframework.web.servlet.theme.FixedThemeResolver

org.springframework.web.servlet.HandlerMapping=org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping

org.springframework.web.servlet.HandlerAdapter=org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,\
 org.springframework.web.servlet.mvc.throwaway.ThrowawayControllerHandlerAdapter

org.springframework.web.servlet.ViewResolver=org.springframework.web.servlet.view.InternalResourceViewResolver

可以看出如果没有相应的配置,DispatcherServlet就会调用默认设置

posted on 2006-06-23 10:03 Dragonofson 阅读(2017) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: