0

I am getting a following GET request http://localhost:8080/flamingo-json/en/web/Mobile/our-program/Tiers-recognition-Redesigned/rewards-program-new.html

For the above url I have defined the following Mapping in spring rest controller

 @GetMapping(value = "/flamingo-json/{language}/{platform}/{page:.+}")
@ResponseBody
public String getAboutUs(@PathVariable(value = "language", required = false) String language,@PathVariable String platform,
                         @PathVariable String page){
    logger.info("Serving " + page + " page for the request");
    return aboutUsService.getPageFromDb(page, language, platform);

but I am unable to get "Mobile/our-program/Tiers-recognition-Redesigned/rewards-program-new.html" value in the Path variable 'page' and I am getting 404.

1 Answer 1

0

if you want to jump to other page, delete the annotation @ResponseBody;if you want to get the value(like json) from this request,change the annotation to @PostMapping. hope the ans works.

Sign up to request clarification or add additional context in comments.

2 Comments

I have removed the @ResponseBody but still I am getting 404, also I have thymeleaf templates, I just want to return string instead of thymeleaf template
you can debug this request, judge whether to enter the request. if can enter the request, try to change the @getmapping to the @postmapping. if not ,maybe regex not in effect. i guess. sorry,I know little about regex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.