Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SpringBootApplication
- public class Application {
- public static void main(String[] args) {
- SpringApplication.run(ServiceNowMediatorApplication.class, args);
- }
- @Bean
- public Alert b(){
- return new B();
- }
- @Bean
- public ServiceB serviceB(B b){
- return new ServiceB(b);
- }
- }
- @RestController
- @RequestMapping("/{database}/alerts")
- public class ControllerB {
- @Autowired private ServiceB serviceB;
- @Autowired
- private B b;
- @Autowired
- ControllerB(B b,ServiceB serviceB){
- this.b = b;
- this.serviceB = serviceB;
- }
- @RequestMapping(method = RequestMethod.POST)
- public B dosomethingCrazy(@RequestBody BImpl bimpl) {
- String response = serviceB.dosomethingImportant();
- return bimpl;
- }
- }
- @Autowired
- public B b;
- @Autowired
- public B getB() {
- return b;
- }
- @Autowired
- public void setB(B b) {
- this.b = b;
- }
- @Autowired
- public ServiceB(B b){
- this.b = b;
- }
- public String dosomethingimportant() {
- b.getValueOfFieldPassedInPOST(field1) ==> THIS RETURNS A NULL
- }
- @RequestMapping(method = RequestMethod.POST)
- public B dosomethingCrazy(@RequestBody BImpl bimpl) {
- **serviceB.setB(bimpl);**
- String response = serviceB.dosomethingImportant();
- return bimpl;
- }
Add Comment
Please, Sign In to add comment