package jp.dip.arimodoki.cntl;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import jp.dip.arimodoki.blogic.BlUserIf;
import jp.dip.arimodoki.model.PromenadeFormIf;
@Scope("prototype")
@Controller
public class Promenade {
@Autowired
private PromenadeFormIf promenadeForm;
@Autowired
private BlUserIf blUser;
@ModelAttribute("PromenadeFormData")
private PromenadeFormIf setupBind() {
this.blUser.setForm(this.promenadeForm);
return this.promenadeForm;
}
@RequestMapping(value = "/promenade")
public String promenade() {
this.promenadeForm.getUser().setUserid(1000);
this.blUser.dbProc();
return "promenade";
}
@SuppressWarnings("unused")
@RequestMapping(value = "/promenaderes")
public String promenaderes(
@Valid @ModelAttribute("PromenadeFormData") PromenadeFormIf formbean,
BindingResult result
) throws Exception {
if (result.hasErrors()) {
return "promenade";
}
this.blUser.dbProc();
return "promenaderes";
}
}
|