Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
- Project formProject = (Project) command;
- String previousPage = (String) request.getSession(true).getAttribute("previous_page");
- if (previousPage != null) {
- setSuccessView("redirect:" + previousPage);
- } else {
- setSuccessView("redirect:main.htm?action=release");
- }
- if (request.getParameter("save_action") != null) {
- String action = request.getParameter("action");
- System.out.println("action: " + action);
- if ("new".equals(action)) {
- formProject.setCreateTime(new Date());
- formProject.setCreateUser("");
- formProject.setUpdateTime(new Date());
- formProject.setUpdateUser("");
- projectDao.save(formProject);
- } else {
- projectDao.update(formProject);
- }
- } else if (request.getParameter("cancel_action") != null) {
- //cancel
- }
- return super.onSubmit(request, response, command, errors);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement