Configuring in Application.yml
Server:port:8080Context-path:/Crmspring:datasource:driver-class-name:com.mysql.jdbc.Driver Url:jdbc:mysql://Localhost:3306/crmusername:root Password:136735Jpa:show-sql:trueJackson:default-property-inclusion:non_null devtools:restart:enabled:trueCxf:path:/services #使用service发布服务, you need to add the following/CRMService Servlet.init:service-list-path:/Info jaxrs:component-scan:true
Service Publishing Services
PackageTop.kylewang.crm.controller;ImportOrg.springframework.stereotype.Service;Importorg.springframework.transaction.annotation.Transactional;ImportOrg.springframework.web.bind.annotation.ResponseBody;ImportJavax.ws.rs.Consumes;ImportJavax.ws.rs.GET;ImportJavax.ws.rs.Path; @Path ("Path") @Service @transactional (rollbackfor= Exception.class) Public classTestpath {@Path ("/p1") @GET @Consumes ({"Application/xml", "Application/json"}) PublicString getString () {return"Path"; }}
Visit http://localhost:8080//crm/services/path/p1
return path
Spring Boot Configuration Service Publishing services