public static View create(StaplerRequest req, StaplerResponse rsp, ViewGroup owner)
throws FormException, IOException, ServletException {
String name = req.getParameter("name");
checkGoodName(name);
if(owner.getView(name)!=null)
throw new FormException(Messages.Hudson_ViewAlreadyExists(name),"name");
String mode = req.getParameter("mode");
if (mode==null || mode.length()==0)
throw new FormException(Messages.View_MissingMode(),"mode");
// create a view
View v = all().findByName(mode).newInstance(req,req.getSubmittedForm());
v.owner = owner;