私はあなたがセッションを使わずにspring mvcの@RequestMappingメソッドでモデルオブジェクトを共有する方法は?
上で見ることができるように、私は他のリクエストmaping方法@RequestMapping("/contentUploadDetails/{content_type}/{date}")
public ModelAndView contentUpload(
@PathVariable(value = "content_type") String content_type,
@PathVariable(value = "date") String date) {
List<CountAndValue> ls = contentCountImp
.getuploadedContentCountDatewise(content_type, date);
model.addObject("CountAndValue", ls);
return model;
}
で使用できるように、マッピング方法をrequestiongにモデルにいくつかの変数を追加したいExcelシートを作成し、ダウンロードして春を使用しています
model.addObject("CountAndValue", ls);
私は私の他のrequestMapping方法私はあることCountAndValueExcelモデルオブジェクトを使用する方法
@RequestMapping(value = "/ContentUploadExport", method = RequestMethod.GET)
public ModelAndView getExcel() {
return new ModelAndView("CountAndValueExcel", "CountAndValue", CountAndValue);
}
でこのモデルの値を使用したいですセッションを使用して第2の方法で第1の方法によって設定されるか?モデルオブジェクト(クラスオブジェクトのリストを含む)をビューからコントローラに返すことはできますか?
あるコントローラから別のコントローラにリダイレクトすると仮定すると、フラッシュ属性、checkout - http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc-flash-属性 –