It's been a while and I'm updating my skills for Spring and Spring boot. To that end, I'm building a web application. Here is part of my controller:
@Controller
public class LoginController {
@RequestMapping(value = "/validate", method= RequestMethod.GET)
@ResponseBody
public String validate( @RequestParam(RequestConstants.KEY_USERKEY) String userkey) {
String result = loginService.validate(userkey)
? RequestConstants.KEY_SUCCESS
: RequestConstants.KEY_FAILURE;
return result;
}
The deployment seems to be going OK, the war is named theta-server and is going into tomcat/webapps OK, so I go to my browser and enter:
http://testbox:8080/theta-server/validate?userkey=bob
and I get a 404.
I look in the logs. Initially, I had nothing, then I found this question: Spring Boot War deployed to Tomcat which led me to these docs: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file and now It's starting the Spring boot app and the banner is displaying in my log file.
There are no errors however, and I'm wondering why I'm getting the 404.
There are messages in the log from Spring Security indicating that there's no controls around validate, so it seems to be getting the request, but not going anywhere with it.
Also, saw: Spring Boot Controller 404 and made sure that my controller is in a package beneath my Application class.
And I have an integration test in place that runs through the entire stack, so I'm confident that the Spring stuff is at least coded correctly.