Przede wszystkim powiedzieć przeprosiny zadać to pytanie powtarzane ..Wiosna, metoda żądanie „POST” nie jest obsługiwana
Właściwie w moim wiosennym zgłoszeniu mam user.jsp
i professional.jsp
tutaj jest mój User.jsp:
<form:form action="profile/user" modelAttribute="profile">
<div>
<jsp:include page="professional.jsp"></jsp:include>
</div>
</form:form>
I tu jest moje professional.jsp:
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<fieldset id="profile_proffiesional">
<form:form action="profile/proffiesional" modelAttribute="PROFESSIONAL" method="POST">
<p>
<label for="position">Position</label>
<form:input path="position" tabindex="4" />
</p>
<p>
<label for="location">Location</label>
<form:input path="location" tabindex="5" />
</p>
<p>
<label for="description">Description</label>
<form:input path="description" tabindex="5" />
</p>
<p>
<input type="submit" value="Add">
</p>
</form:form>
</fieldset>
A oto moja klasa Kontroler:
@Controller
@RequestMapping(value = "profile")
public class UserProfileController {
@Autowired
private UserService userService;
@Autowired
private SessionData sessionData;
@RequestMapping(value = "user", method = RequestMethod.GET)
public String user(Model model) throws Exception {
model.addAttribute("PROFESSIONAL", new UserProfessionalForm());
model.addAttribute("EDUCATIONAL", new UserEducationalForm());
model.addAttribute("AWARDS", new UserAwardsForm());
return "profile/user";
}
@RequestMapping(value = "proffessional", method = RequestMethod.POST)
public @ResponseBody
String forgotPassword(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";
}
}
Problem
jest, gdy jesteśmy Kliknij Add
przycisk w professional.jsp
, nie ma odpowiedzi w konsoli serwera, ale poniżej komunikat ostrzegawczy pokazany:
29 Mar, 2013 1:03:51 PM org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver handleHttpRequestMethodNotSupported
WARNING: Request method 'POST' not supported
Dlaczego Ostrzeżenie nadchodzi ? Jestem już określony method = "POST" ..
Proszę o pomoc ..
ponownie pojawia się ostrzeżenie: 29 marca 2013 13:37:32 po org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver handleHttpRequestMethodNotSupported UWAGA: Metoda żądania 'POST' nie jest obsługiwany .. –