I want to create preview page i.e let us consider a registration form and before submit data to database user should see preview of data what they entered. i am using Spring mvc 3.0 and hibernate
=> this is my controller method, after submit it is going to database and inserting data and i am displaying that data on grid
@RequestMapping( value="/catalogue/create.action", method=RequestMethod.POST)
public ModelAndView create(@ModelAttribute CatalogueBase catalogueForm) throws Exception {
ModelAndView mvc = null;
try{
List<CatalogueBase> catalogueBases = new ArrayList<CatalogueBase>(); //getCatalogueBase(request);
catalogueBases.add(catalogueForm);
List<CatalogueBase> catalogueBaseList = catalogueService.create(catalogueBases);
mvc = new ModelAndView("catalogue/catalogueList");
} catch (Exception e) {
e.printStackTrace();
}
return mvc;
}
=> now i kept one method it goes to preview page and if data is ok then it go to above method to insert into database
@RequestMapping( value="/catalogue/FormPreview.action", method=RequestMethod.POST)
public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command) throws Exception {
CatalogueBase catalogueBase = new CatalogueBase();
// hear i setting only one value
request.setAttribute("titleNo", catalogueBase.getTitleNumber());
return new ModelAndView("catalogue/catalogueFormPreview","catalogueBase",catalogueBase);
}
and in jsp i gave EL like this ===== > ${catalogueBase.titleNo}
but it is getting null values
thanks in advance