1

この投稿リクエストを送信すると、次のエラーが発生しました。

 org.springframework.web.HttpSessionRequiredException: Expected session attribute
 'form' 
 at   org.springframework.web.method.annotation.ModelFactory.initModel

この種の例外の原因 (可能性) は何ですか? Spring MVC を使用してこの Web アプリケーションを開発しています。

@RequestMapping(value = "/new/form",params ="mode",method = RequestMethod.POST)
public String newForm(@ModelAttribute("form") ApplicationForm form,

                               BindingResult bindingResult,
                               @RequestParam String mode,
                               Model model,
                               SessionStatus sessionStatus) {

    return showSearchForm(model);
} 
4

2 に答える 2

2

クラスの冒頭でこれらの注釈を使用してみてください

@SessionAttributes({"フォーム"})

@コントローラ

于 2013-07-15T12:53:19.850 に答える