Skip to content

Instantly share code, notes, and snippets.

@willianantunes
Created August 11, 2018 16:24
Show Gist options
  • Save willianantunes/80c8991cf5f08ed1f5e9d8dd090ff817 to your computer and use it in GitHub Desktop.
Save willianantunes/80c8991cf5f08ed1f5e9d8dd090ff817 to your computer and use it in GitHub Desktop.
@Controller
public class SampleController {
private static final Logger LOGGER = LoggerFactory.getLogger(SampleController.class);
@Autowired
private SampleService sampleService;
@GetMapping(REQUEST_PATH_SAMPLE)
public ModelAndView sample(@RequestHeader(HONEST_SAMPLE_HEADER) String honestSampleHeader) {
LOGGER.info("What was received in {}: {}", HONEST_SAMPLE_HEADER, honestSampleHeader);
sampleService.doTheThing(() -> honestSampleHeader);
ModelAndView view = new ModelAndView(VIEW_PATH_SAMPLE);
view.addObject(HONEST_SAMPLE_ATTRIBUTE, honestSampleHeader);
return view;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment