#Why this not returning a view page?

1 messages · Page 1 of 1 (latest)

worn basinBOT
#

<@&987246527741304832> please have a look, thanks.

#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

craggy belfry
#

is the annotation @Controller used for class? Do you have a view in right folder matching with this name? Also what does show up?

median spear
#

you know providing more context when writing a question is useful, show the class and mention you're using debugging mode or not.

#

without providing any context then all solutions will be just assumptions
, you could be missing @RestController or @Controller in the class or if you aren't using debugging mode then the problem would be that you're missing the name in the @PathVariable annotation.

maiden dock
# median spear you know providing more context when writing a question is useful, show the clas...

@Controller
public class UserController {
@Autowired
private UserRepo userRepo;
@Autowired
private GuideRepo guide;
@Autowired
private GuideController guideController;;

@GetMapping("/")
public String home() {
    return "home";
}


@GetMapping("/register")
public String showRegistrationForm(Model model) {
    model.addAttribute("userRegistrationForm", new User());
    return "register";
}

@GetMapping("/guideDetails/{email}")
public String showGuideDetails(@PathVariable String email, Model model) {
Guide guide = userRepo.getGuide(email);
return "guideDetails";
}

median spear
maiden dock
craggy belfry
#

do none of the mappings work? You didn't share where the views rest in your project structure, iirc it should be inside resources/templates or if there's any error message that pops up.