代碼怎么來的能不能說一下,這樣真的很難聽懂。而且用SpringMVC一定要搭上Maven嗎?如果不用不能只講springmvc,這個才是重點不是嗎
2018-02-27
mvn archetype:generate -DgroupId=imooc-arthur -DartifactId=spring-mvc-study -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeCatalog=internal 最終命令
2018-02-27
mvn archetype:generate -DgroupId=imooc-arthur-DartifactId=spring-mvc-study -DarchetypeArtifactId=maven-archetype-webapp
2018-02-27
7分鐘左右出現(xiàn)的spring配置文件中的問題
<context:annotation-config/>標簽的作用是向spring容器中注入@Autowired @Resource @PostConstruct @PreDestory 4個注解對應(yīng)的beanPostProcessor 以便后續(xù)使用。
而<context:component-scan>標簽的作用包含了<context:annotation-config/>的功能,并且會開啟自動的組件掃描功能,掃描basepackage屬性指定的包路徑。
當兩個標簽都配置在xml文件中時,只有后者會起作用
<context:annotation-config/>標簽的作用是向spring容器中注入@Autowired @Resource @PostConstruct @PreDestory 4個注解對應(yīng)的beanPostProcessor 以便后續(xù)使用。
而<context:component-scan>標簽的作用包含了<context:annotation-config/>的功能,并且會開啟自動的組件掃描功能,掃描basepackage屬性指定的包路徑。
當兩個標簽都配置在xml文件中時,只有后者會起作用
2018-02-22