1 24 package org.riotfamily.riot.list.command.dialog; 25 26 import org.riotfamily.forms.Form; 27 import org.riotfamily.riot.list.command.CommandContext; 28 import org.riotfamily.riot.list.command.CommandResult; 29 import org.riotfamily.riot.list.command.core.AbstractCommand; 30 import org.riotfamily.riot.list.command.result.GotoUrlResult; 31 import org.springframework.web.servlet.ModelAndView; 32 33 37 public abstract class DialogCommand extends AbstractCommand { 38 39 public final CommandResult execute(CommandContext context) { 40 context.getRequest().getSession().setAttribute( 41 getFormSessionAttribute(), createForm(context.getBean())); 42 43 return new GotoUrlResult(context, getRiotServletPrefix() 44 + "/dialog/" + getId()); 45 } 46 47 public String getFormSessionAttribute() { 48 return getClass().getName() + ".form"; 49 } 50 51 public abstract Form createForm(Object bean); 52 53 public abstract ModelAndView handleInput(Object input); 54 55 } 56 | Popular Tags |