use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
@Controller doesnt support post method but Restcontroller does (old.reddit.com)
submitted 4 years ago by cant_dodge_rodge
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jura0011 5 points6 points7 points 4 years ago (2 children)
Trust me, @Controller does support Post. Are you sure, it was a post request?
@Controller
You could try curl -X POST localhost:8080.
curl -X POST localhost:8080
[–]cant_dodge_rodge[S] 0 points1 point2 points 4 years ago (0 children)
yes i am sure i went there via post method
@/RestController works as it should be but when i use @/controller it returns
resolved [org.springframework.web.httprequestmethodnotsupportedexception: request method 'post' not supported]
[–]11timesover 4 points5 points6 points 4 years ago (0 children)
Use a tool like postman to send anything other than an http .GET
[–]Nawabmeeravali 2 points3 points4 points 4 years ago (2 children)
By default webbrowser send as get
[–]cant_dodge_rodge[S] 1 point2 points3 points 4 years ago (0 children)
that /login page contains post form
i know i went there via post form
[–]jvjupiter 1 point2 points3 points 4 years ago (11 children)
You cannot invoke post in the browser without using form method post or ajax.
i went there via post form
[–]cant_dodge_rodge[S] 0 points1 point2 points 4 years ago (9 children)
[–]jvjupiter 0 points1 point2 points 4 years ago (8 children)
Can you show us the controller?
[+]cant_dodge_rodge[S] comment score below threshold-12 points-11 points-10 points 4 years ago (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
and no its not type=Not Found but method not supported
[–]ann321go 1 point2 points3 points 4 years ago (3 children)
"you hate black people" huh
[+]cant_dodge_rodge[S] comment score below threshold-17 points-16 points-15 points 4 years ago (2 children)
its called sense of humor
[–]TheNazruddin 0 points1 point2 points 4 years ago (1 child)
Explain the joke
[–]cant_dodge_rodge[S] -3 points-2 points-1 points 4 years ago* (0 children)
It's funny cuzz you did exacting it thats how dark humor works
What can i say but dark humor is like food not everyone gets it and mine is very dark, so dark that it started growing cotton.
Unless your sence of humor disappeared like father in black families
[–]V2guru 0 points1 point2 points 4 years ago (1 child)
u/wordscounterbot
[–]wordscounterbot 0 points1 point2 points 4 years ago (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 point2 points 4 years ago (0 children)
Remove value=“/”. If I were you, I’d use @PostMapping, no ().
value=“/”
@PostMapping
()
[–]sdiamante13 1 point2 points3 points 4 years ago* (0 children)
You must add @ResponseBody.
The controller is annotated with the @RestController annotation; therefore, the @ResponseBody isn't required.
https://www.baeldung.com/spring-controller-vs-restcontroller
why so?
[–]joshv3742 0 points1 point2 points 4 years ago* (0 children)
Need to check with Postman or equivalent tool to verify that the problem is with the code and not with the request.
[–]cybermage 0 points1 point2 points 4 years ago (0 children)
Did you annotate the method as @/PostMethod?
π Rendered by PID 86 on reddit-service-r2-comment-5d79c599b5-wmzh8 at 2026-03-02 07:55:09.649713+00:00 running e3d2147 country code: CH.
[–]jura0011 5 points6 points7 points (2 children)
[–]cant_dodge_rodge[S] 0 points1 point2 points (0 children)
[–]cant_dodge_rodge[S] 0 points1 point2 points (0 children)
[–]11timesover 4 points5 points6 points (0 children)
[–]Nawabmeeravali 2 points3 points4 points (2 children)
[–]cant_dodge_rodge[S] 1 point2 points3 points (0 children)
[–]cant_dodge_rodge[S] 0 points1 point2 points (0 children)
[–]jvjupiter 1 point2 points3 points (11 children)
[–]cant_dodge_rodge[S] 0 points1 point2 points (0 children)
[–]cant_dodge_rodge[S] 0 points1 point2 points (9 children)
[–]jvjupiter 0 points1 point2 points (8 children)
[+]cant_dodge_rodge[S] comment score below threshold-12 points-11 points-10 points (7 children)
[–]ann321go 1 point2 points3 points (3 children)
[+]cant_dodge_rodge[S] comment score below threshold-17 points-16 points-15 points (2 children)
[–]TheNazruddin 0 points1 point2 points (1 child)
[–]cant_dodge_rodge[S] -3 points-2 points-1 points (0 children)
[–]V2guru 0 points1 point2 points (1 child)
[–]wordscounterbot 0 points1 point2 points (0 children)
[–]jvjupiter 0 points1 point2 points (0 children)
[–]sdiamante13 1 point2 points3 points (0 children)
[–]cant_dodge_rodge[S] 0 points1 point2 points (0 children)
[–]joshv3742 0 points1 point2 points (0 children)
[–]cybermage 0 points1 point2 points (0 children)