Closed Chumper closed 8 years ago
I'm not sure, given the information here. A couple of things to consider/try:
First, try making a request to /connect/status (without a trailing slash). See if that makes a difference.
If not, then can you provide a project that recreates this (not necessarily your real project...just a facsimile that exhibits this behavior will be fine) in GitHub?
Kindly Post the Controller code of the class for which you are using RequestMapping(''/connect") may be you are using RequestMethod.DELETE/POST in that method which is getting called on /connect mapping, so it won't work for POST/PUT/DELETE calls you need to make panel then write its whole Ajax calls to see it actually working from browser, if you try typing in address bar then it is a GET request ,
@RestController @RequestMapping("/customer") public class CustomerController {
@RequestMapping(value="/delete/id/{id}",method={RequestMethod.GET,RequestMethod.DELETE}) public Map<String,String> deleteCustomerById( @PathVariable("id") String id){ mCustomerRepository.deleteById(id);
Map<String,String> response = new HashMap<String,String>();
response.put("report", "Customer removed");
return response;
}
} this is how i am using Delete request to delete a document from MongoDB 192.168.0.100:8080/customer/delete/id/56e128c2475a426f50cf9303 and 'deleteById' is a simple void method method in my Repository class with @Param("id") to match the POJO.
There are three ways to test without banging your head why it is not working. 1- Make 'TEST' cases using Spring MVC features for static data test. 2- Make a complete panel then write Ajax calls for requests. 3- Make a simple java project to test it statically.
Hope i help somebody.
Im also facing the same problem org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'GET' not supported]
@RequestMapping(value ="/Insertdata",method = RequestMethod.POST) public String putData(@RequestBody UserAccount userac) { try { jdbcTemplate.execute("INSERT INTO UserAccount(ID,Name,age) VALUES (01,'Kishri Jee',16)"); } but for retrieve its working fine
Please help me
http://localhost:8080/signup-action
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.
Fri Feb 26 16:41:33 IST 2021 There was an unexpected error (type=Method Not Allowed, status=405). Request method 'GET' not supported
This is controller @RestController @RequestMapping(value = "/signup-action", method = RequestMethod.POST) public ModelAndView doFreeTrailAction(@Valid @ModelAttribute("form") InitialDetail initialDetail, BindingResult bindingResult, HttpServletRequest request) throws IOException {
logger.info("Performing sign up action for..." + initialDetail);
Cookie cookie = WebUtils.getCookie(request, "sourceId");
String sourceId = null;
if (cookie != null) {
sourceId = cookie.getValue();
}
so please tell me if anybody knows
Ok, i have included the following plugins:
i am using spring boot
1.3.0.M5
my config looks like this:if I want to see my connections, i get a 405
The log tells me this:
So there is a request to
connect/connect/status
which has no handler obvious.Did i configure something wrong? When I post to
connect/github
, so enabled github and have a valid id and key it will redirect me, so there is a template problem i guess.Any solutions?
Edit: This also happens with spring boot
1.2.5.RELEASE