I have an issue after I install postman. I try to work with REST service but firstly I want to check how it works on normal browser. So I tried on latest pages with normal view like that one below:
@Controller
public class HomeController {
@RequestMapping("/")
public String welcome(Model model)
{
model.addAttribute("greeting", "Witaj w sklepie internetowym");
model.addAttribute("tagline", "Wyjątkowym i jedynym sklepie");
return "welcome";
}
@RequestMapping ("/welcome/greeting")
public String greeting() {
return "welcome";
}
}
It works fine I get back the .jsp page. Later I want to get the REST page in postman:
@Controller
@RequestMapping(value = "rest/cart")
public class CartRestController {
@Autowired
private ICartService cartService;
@Autowired
private IProductService productService;
@RequestMapping(method = RequestMethod.POST)
public @ResponseBody Cart create(@RequestBody Cart cart) {
return cartService.create(cart);
}
But then i receive HTTP 404 - not found status, and even if I want to get my "normal" pages with view i get always HTTP 404 status. In console log I getting also this error below but the server starts. So i dont know I have that one before. I tried to remedy with it like someone said on this answer https://stackoverflow.com/a/8128255/7491837 but it dont help me.
SEVERE: Error configuring application listener of class [org.springframework.web.context.ContextLoaderListener]
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
And also i tried to turn off my code with REST services but it dosen't help me. Any ideas what can be wrong? I'm stuck..