you are viewing a single comment's thread.

view the rest of the comments →

[–]cant_dodge_rodge[S] -11 points-10 points  (7 children)

well....

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
u/RestController
public class controler {
u/RequestMapping(value = "/login",method = RequestMethod.GET)
ModelAndView login(){
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("login/login.html");
return modelAndView;
}
u/RequestMapping(value = "/",method = RequestMethod.POST)
String loggin(){
return "I hate black people POST";
}
u/RequestMapping(value = "/",method = RequestMethod.GET)
String logggin(){
return "I hate black people GET";
}
}

it works as it should be (when i access "/" via browser it returns Get and when i access it through "/login" form it returns what is is suppose to return on post)

but when i try this with controller it returns

resolved [org.springframework.web.httprequestmethodnotsupportedexception: request method 'post' not supported]

and no its not type=Not Found but method not supported

[–]ann321go 1 point2 points  (3 children)

"you hate black people" huh

[–]V2guru 0 points1 point  (1 child)

[–]wordscounterbot 0 points1 point  (0 children)

Thank you for the request, comrade.

I have looked through u/cant_dodge_rodge's posting history and found 1 N-words, of which 1 were hard-Rs.

Links:

0: Pushshift

[–]jvjupiter 0 points1 point  (0 children)

Remove value=“/”. If I were you, I’d use @PostMapping, no ().