Requestmethod POST not supported || Spring login
I think there is issue in this line in both method
@RequestMapping(value = "/login-success", method = {RequestMethod.POST,
RequestMethod.GET})
You have configured both GET and POST for a rest call
Try this
@RequestMapping(value = "/login-success", method=RequestMethod.POST)
Spring,Request method 'POST' not supported
Your user.jsp:
<form:form action="profile/proffesional" modelAttribute="PROFESSIONAL">
---
---
</form:form>
In your controller class:
(make it as a meaning full method name..Hear i think you are insert record in DB.)
@RequestMapping(value = "proffessional", method = RequestMethod.POST)
public @ResponseBody
String proffessionalDetails(
@ModelAttribute UserProfessionalForm professionalForm,
BindingResult result, Model model) {
UserProfileVO userProfileVO = new UserProfileVO();
userProfileVO.setUser(sessionData.getUser());
userService.saveUserProfile(userProfileVO);
model.addAttribute("PROFESSIONAL", professionalForm);
return "Your Professional Details Updated";
}
Spring boot - Request method 'POST' not supported. Tried everything
Following might help.
- While you deploy the application, spring boot displays all the
available services on the console. Check the POST method to create
is being displayed or not. Check that there shouldn't be any contradiction with other services. GET/PUT/POST - If there are services not deployed, try adding '/' before other services - GET, PUT, POST.
- Adding exception handler(link) to check the client input request to check the POJO structure.
- Check the URL - If any global path for app/name added with
configuration.(link) - Try to remove headers - Content-Type in the request header and post
the request again
Following are different things that can happen. Need not to be followed in order.
EDIT:
Run the following to check whether your controller is being enabled and considered by the spring application or not.
import java.util.Arrays;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
ApplicationContext ctx = SpringApplication.run(Application.class, args);
System.out.println("Let's inspect the beans provided by Spring Boot:");
String[] beanNames = ctx.getBeanDefinitionNames();
Arrays.sort(beanNames);
for (String beanName : beanNames) {
System.out.println(beanName);
}
}
}
Spring MVC Request method 'PATCH' not supported
I tried on a demo spring boot application and patch is working as expected.
There is one unrelated issue in your code... You are using @PathVariable("id")
in updateById
method without having a pathVariable
placeholder in the URI.
Related Topics
How to Force a Method to Throw an Exception in Junit Testing
Java.Lang.Noclassdeffounderror: Org/Springframework/Core/Env/Configurableenvironment
Java.Lang.Noclassdeffounderror: Lorg/Apache/Logging/Log4J/Logger; But the Artifact Exists
Correct Way to Focus an Element in Selenium Webdriver Using Java
Http 415 Unsupported Media Type Error With Json
Jpa- Joining Two Tables in Non-Entity Class
In Java, How to Determine If a Char Array Contains a Particular Character
How to Have Each Record of Json on a Separate Line
How to Use Jackson to Deserialise an Array of Objects
How to Increase the Java Heap Size Permanently
Jackson @Jsonproperty Not Working If Property Name Not Equal Field Name
Javax.Validation - Allow Null But Validate If the Value Is Not
Spring Boot - Post Method Not Allowed, But Get Works
Java: How to Ask User If He/She Wants to Continue Program
Remove Duplicate Values from Hashmap in Java
Java.Sql.Sqlexception: Access Denied for User 'Root'@'Localhost' (Using Password: Yes)