liubao68 commented on issue #1402: SpringBoot2+SpringMVC集成的两个问题 URL: https://github.com/apache/servicecomb-java-chassis/issues/1402#issuecomment-556830848 问题1:认证鉴权逻辑可以参考下[servicecomb-fence](https://github.com/apache/servicecomb-fence),里面提供了hasRole的实现。这个是完全基于java-chassis提供的认证鉴权实现。 由于spring-secrity强依赖于servlet协议(即web容器),所以无法直接在java-chassis使用,要使用就必须使用servlet模式运行。 这个[项目](https://github.com/huaweicse/cse-java-chassis-samples/tree/master/multi-framework/auth)提供了一个使用spring security的例子,理解起来相对还是比较复杂,servicecomb-fence在使用java-chassis的情况下更好理解。 问题2: 一个应用中, spring mvc servlet和servicecomb-java-chassis的servlet并存是可以的。 你可以共享一个简单的demo,看下你的问题在哪儿。 或者参考这个[项目](https://github.com/huaweicse/cse-java-chassis-samples/blob/master/porter/porter_springboot2/user-service/pom.xml)配置pom, 核心点是注意依赖下面的组件 ``` <dependency> <groupId>org.apache.servicecomb</groupId> <artifactId>spring-boot2-starter-servlet</artifactId> </dependency> ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
