当前位置:首页>开发>正文

spring-boot-starter-web默认是哪个版本 在SpringBoot里 webSocket方法怎么注入service

2023-06-24 13:46:23 互联网 未知 开发

 spring-boot-starter-web默认是哪个版本 在SpringBoot里 webSocket方法怎么注入service

spring-boot-starter-web默认是哪个版本

这个跟spring mvc一样的啊,首先你看你的spring-mvc.xml 有没有配置defaultViewResolver, 然后你在action的方法中如果1.标注了@ResponseBody,返回字符串的话是通过write输出到页面。2.没有标注这个,spring mvc会到配置的目录下 找相应的jsp。...

在SpringBoot里 webSocket方法怎么注入service

通过ApplicationContext来获取。具体如下类似:
ApplicationContext ac = new FileSystemXmlApplicationContext("src/beans.xml")
TuserService tuserService = (TuserServiceImpl) ac.getBean("tuserTarget")

最新文章