저는 Spring 3.1.0.RELEASE를 사용하고 있습니다. 어떤 이유로 인해 내 컨트롤러에서 오류가 발생했을 때 폼을 POST하고 원래 화면으로 되돌릴 때 GET 메서드를 통해 페이지를 호출 할 때와 같이 모델 특성이 채워지지 않습니다. 내 컨트롤러에 있음스프링 모델에 적절한 속성이 채워지지 않는 이유는 무엇입니까?
@Controller
public class StandardsUploadController {
…
@RequestMapping(value = "/upload")
public String getUploadForm(Model model) {
model.addAttribute(new StandardsUploadItem());
model.addAttribute("gradeList", gradeList);
model.addAttribute("subjectList", subjectList);
return "upload/index";
}
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public ModelAndView processFile(final StandardsUploadItem uploadItem,
final BindingResult result,
final HttpServletRequest request,
final HttpServletResponse response) throws InvalidFormatException, CreateException, NamingException {
stdsUploadValidator.validate(uploadItem, result);
if (!result.hasErrors()) {
try {
…
} catch (IOException e) {
LOG.error(e.getMessage(), e);
e.printStackTrace();
}
} // if
return new ModelAndView("upload/index");
}
내가 뭘 잘못하고 어떻게 해결할 수 있습니까?