咱们本身写的solr查询的代码做为search项目中的dao

咱们本身写的solr查询的代码做为search项目中的dao,可是启动时会报错:spring

其实就是说 searchServiceImpl 中咱们 Autowired 的 SearchDao 类 spring 扫描不到,express

缘由是:这个dao是咱们本身写的,而不是以往用 mybatis的 Mapper扫描的形式加载的,而咱们如今 在spring中只配置 Service 包的注解扫描浏览器

因此要改成以下配置:mybatis

注意:若是用方法2,则expression 的值为 Controller 类上的 @Controller 注解的 全限定名。app

 

从新启动,没问题,而后在浏览器模拟访问:debug

 

 

 后台debugger发现,Controller中接收到的参数乱码。blog

 

解决方法:io

加上乱码转换便可:后台

相关文章
相关标签/搜索