当前位置: 首页>>代码示例>>Java>>正文


Java DynaValidatorForm.get方法代码示例

本文整理汇总了Java中org.apache.struts.validator.DynaValidatorForm.get方法的典型用法代码示例。如果您正苦于以下问题:Java DynaValidatorForm.get方法的具体用法?Java DynaValidatorForm.get怎么用?Java DynaValidatorForm.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.struts.validator.DynaValidatorForm的用法示例。


在下文中一共展示了DynaValidatorForm.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveContact

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward saveContact(ActionMapping mapping, ActionForm form, 
		HttpServletRequest request, HttpServletResponse response) {
	
	if(!securityInfoManager.hasPrivilege(LoggedInInfo.getLoggedInInfoFromSession(request), "_demographic", "w", null)) {
       	throw new SecurityException("missing required security object (_demographic)");
       }
	
	DynaValidatorForm dform = (DynaValidatorForm)form;
	Contact contact = (Contact)dform.get("contact");
	String id = request.getParameter("contact.id");
	if(id != null && id.length()>0) {
		Contact savedContact = contactDao.find(Integer.parseInt(id));
		if(savedContact != null) {
			BeanUtils.copyProperties(contact, savedContact, new String[]{"id"});
			contactDao.merge(savedContact);
		}
	}
	else {
		contact.setId(null);
		contactDao.persist(contact);
	}
   return mapping.findForward("cForm");
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:24,代码来源:ContactAction.java

示例2: edit

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws Exception {

    DynaValidatorForm classForm = (DynaValidatorForm) form;

    String className = (String) classForm.get("className");

    User userView = Authenticate.getUser();

    InfoClass infoClassOld = (InfoClass) request.getAttribute(PresentationConstants.CLASS_VIEW);

    InfoClass infoClassNew = null;
    try {
        infoClassNew = (InfoClass) EditarTurma.run(infoClassOld.getExternalId(), className);
    } catch (DomainException e) {
        throw new ExistingActionException("A SchoolClass", e);
    }

    request.removeAttribute(PresentationConstants.CLASS_VIEW);
    request.setAttribute(PresentationConstants.CLASS_VIEW, infoClassNew);

    return prepare(mapping, form, request, response);
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:24,代码来源:ManageClassDA.java

示例3: create

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws Exception {

    DynaValidatorForm classForm = (DynaValidatorForm) form;
    String className = (String) classForm.get("className");

    InfoCurricularYear infoCurricularYear = (InfoCurricularYear) request.getAttribute(PresentationConstants.CURRICULAR_YEAR);
    InfoExecutionDegree infoExecutionDegree =
            (InfoExecutionDegree) request.getAttribute(PresentationConstants.EXECUTION_DEGREE);
    AcademicInterval academicInterval =
            AcademicInterval.getAcademicIntervalFromResumedString((String) request
                    .getAttribute(PresentationConstants.ACADEMIC_INTERVAL));

    Integer curricularYear = infoCurricularYear.getYear();

    try {
        CriarTurma.run(className, curricularYear, infoExecutionDegree, academicInterval);

    } catch (DomainException e) {
        throw new ExistingActionException("A SchoolClass", e);
    }

    return listClasses(mapping, form, request, response);
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:25,代码来源:ManageClassesDA.java

示例4: saveProContact

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward saveProContact(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
	DynaValidatorForm dform = (DynaValidatorForm)form;
	ProfessionalContact contact = (ProfessionalContact)dform.get("pcontact");
	String id = request.getParameter("pcontact.id");	
	
	if(id != null && id.length()>0) {
		contact.setId(Integer.valueOf(id));
	}
	if(contact.getId() != null && contact.getId()>0) {
		proContactDao.merge(contact);
	} else {
		ProfessionalContact contactNew = new ProfessionalContact();
		BeanUtils.copyProperties(contact, contactNew, new String[]{"id"});
		proContactDao.persist(contactNew);
	}
   return mapping.findForward("pForm");
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:18,代码来源:ContactAction.java

示例5: save

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {    	
LoggedInInfo loggedInInfo=LoggedInInfo.getLoggedInInfoFromSession(request);

DynaValidatorForm f = (DynaValidatorForm)form;
  	EyeformTestBook data = (EyeformTestBook)f.get("data");
  	if(data.getId()!=null && data.getId()==0) {
  		data.setId(null);
  	}
  	data.setProvider(loggedInInfo.getLoggedInProviderNo());	
  	dao.save(data);
  	
  	return mapping.findForward("success");
  }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:14,代码来源:TestBookAction.java

示例6: save

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {    	
LoggedInInfo loggedInInfo=LoggedInInfo.getLoggedInInfoFromSession(request);

DynaValidatorForm f = (DynaValidatorForm)form;
  	EyeformProcedureBook data = (EyeformProcedureBook)f.get("data");
  	if(data.getId()!=null && data.getId()==0) {
  		data.setId(null);
  	}
  	data.setProvider(loggedInInfo.getLoggedInProviderNo());	
  	procedureBookDao.save(data);
  	
  	return mapping.findForward("success");
  }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:14,代码来源:ProcedureBookAction.java

示例7: save

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
  	DynaValidatorForm f = (DynaValidatorForm)form;
  	EyeformOcularProcedure procedure = (EyeformOcularProcedure)f.get("proc");

  	LoggedInInfo loggedInInfo=LoggedInInfo.getLoggedInInfoFromSession(request);

  	EyeformOcularProcedureDao dao = (EyeformOcularProcedureDao)SpringUtils.getBean("ocularProcDao");
procedure.setProvider(loggedInInfo.getLoggedInProviderNo());

  	if(request.getParameter("proc.id") != null && request.getParameter("proc.id").length()>0) {
  		procedure.setId(Integer.parseInt(request.getParameter("proc.id")));
  	}

  	if(procedure.getId() != null && procedure.getId() == 0) {
  		procedure.setId(null);
  	}
  	procedure.setUpdateTime(new Date());

  	if(procedure.getId() == null) {
  		dao.persist(procedure);
  	} else {
  		dao.merge(procedure);
  	}

  	if (request.getParameter("json") != null && request.getParameter("json").equalsIgnoreCase("true")) {
	HashMap<String, Integer> hashMap = new HashMap<String, Integer>();
	hashMap.put("saved", procedure.getId());

	JSONObject json = JSONObject.fromObject(hashMap);
	response.getOutputStream().write(json.toString().getBytes());

	return null;
}

  	request.setAttribute("parentAjaxId", "ocularprocedure");
  	return mapping.findForward("success");
  }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:38,代码来源:OcularProcAction.java

示例8: save

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {    	
	DynaValidatorForm f = (DynaValidatorForm)form;
	EyeformFollowUp data = (EyeformFollowUp)f.get("followup");
	if(data.getId()!=null && data.getId()==0) {
		data.setId(null);
	}
	
	dao.save(data);
	
	
	return mapping.findForward("success");
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:13,代码来源:FollowUpAction.java

示例9: delete

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {

		if(!securityInfoManager.hasPrivilege(LoggedInInfo.getLoggedInInfoFromSession(request), "_admin", "w", null)) {
        	throw new SecurityException("missing required security object (_admin)");
        }

		DynaValidatorForm frm = (DynaValidatorForm)form;
		String style = (String)frm.get("editStyle");		
		List<CssStyle>styles = cssStylesDao.findAll();;
		int idx = 0;
		for( CssStyle cssStylecurrent: styles ) {
			if( cssStylecurrent.getStyle().equalsIgnoreCase(style)) {
				cssStylecurrent.setStatus(CssStyle.DELETED);
				cssStylesDao.merge(cssStylecurrent);
				styles.remove(idx);
				
				BillingServiceDao billingServiceDao = (BillingServiceDao) SpringUtils.getBean("billingServiceDao");
				List<BillingService> serviceCodes = billingServiceDao.findBillingCodesByFontStyle(cssStylecurrent.getId());
				for( BillingService servicecode : serviceCodes ) {
					servicecode.setDisplayStyle(null);
					billingServiceDao.merge(servicecode);
				}
				break;
			}
			++idx;
		}
									
		frm.set("styles", styles);
		request.setAttribute("success", "true");
		
		return mapping.findForward("init");
	}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:33,代码来源:ManageCSSAction.java

示例10: sort

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward sort(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws Exception {
    DynaValidatorForm roomSearchForm = (DynaValidatorForm) form;

    String[] availableRoomsId = (String[]) roomSearchForm.get("availableRoomsId");
    String sortParameter = request.getParameter("sortParameter");
    List<InfoRoom> availableRooms = new ArrayList<InfoRoom>();
    for (String element : availableRoomsId) {
        final Space room = FenixFramework.getDomainObject(element);
        availableRooms.add(InfoRoom.newInfoFromDomain(room));
    }
    if ((sortParameter != null) && (sortParameter.length() != 0)) {
        if (sortParameter.equals("name")) {
            Collections.sort(availableRooms, new BeanComparator("nome"));
        } else if (sortParameter.equals("type")) {
            Collections.sort(availableRooms, new BeanComparator("tipo"));
        } else if (sortParameter.equals("building")) {
            Collections.sort(availableRooms, new BeanComparator("edificio"));
        } else if (sortParameter.equals("floor")) {
            Collections.sort(availableRooms, new BeanComparator("piso"));
        } else if (sortParameter.equals("normal")) {
            Collections.sort(availableRooms, new ReverseComparator(new BeanComparator("capacidadeNormal")));
        } else if (sortParameter.equals("exam")) {
            Collections.sort(availableRooms, new ReverseComparator(new BeanComparator("capacidadeExame")));
        }
    } else {
        Collections.sort(availableRooms, new BeanComparator("nome"));
    }

    String sdate = roomSearchForm.get("day") + "/" + roomSearchForm.get("month") + "/" + roomSearchForm.get("year");
    String startTime = roomSearchForm.get("beginningHour") + ":" + roomSearchForm.get("beginningMinute");
    String endTime = roomSearchForm.get("endHour") + ":" + roomSearchForm.get("endMinute");
    request.setAttribute(PresentationConstants.DATE, sdate);
    request.setAttribute(PresentationConstants.START_TIME, startTime);
    request.setAttribute(PresentationConstants.END_TIME, endTime);
    request.setAttribute(PresentationConstants.AVAILABLE_ROOMS, availableRooms);
    request.setAttribute(PresentationConstants.AVAILABLE_ROOMS_ID, availableRoomsId);

    return mapping.findForward("showRooms");
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:41,代码来源:RoomSearchDA.java

示例11: save

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {    	
	DynaValidatorForm f = (DynaValidatorForm)form;
	EyeformTestBook data = (EyeformTestBook)f.get("data");
	if(data.getId()!=null && data.getId()==0) {
		data.setId(null);
	}
	TestBookRecordDao dao = (TestBookRecordDao)SpringUtils.getBean("TestBookDAO");
	data.setProvider(LoggedInInfo.loggedInInfo.get().loggedInProvider.getProviderNo());	
	dao.save(data);
	
	return mapping.findForward("success");
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:13,代码来源:TestBookAction.java

示例12: save

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {    	
	DynaValidatorForm f = (DynaValidatorForm)form;
	EyeformProcedureBook data = (EyeformProcedureBook)f.get("data");
	if(data.getId()!=null && data.getId()==0) {
		data.setId(null);
	}
	ProcedureBookDao dao = (ProcedureBookDao)SpringUtils.getBean("ProcedureBookDAO");
	data.setProvider(LoggedInInfo.loggedInInfo.get().loggedInProvider.getProviderNo());	
	dao.save(data);
	
	return mapping.findForward("success");
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:13,代码来源:ProcedureBookAction.java

示例13: save

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
  	DynaValidatorForm f = (DynaValidatorForm)form;
  	EyeformSpecsHistory specs = (EyeformSpecsHistory)f.get("specs");
  	if(specs.getId()!=null && specs.getId()==0) {
  		specs.setId(null);
  	}
  	SpecsHistoryDao dao = (SpecsHistoryDao)SpringUtils.getBean("SpecsHistoryDAO");
  	specs.setProvider(LoggedInInfo.loggedInInfo.get().loggedInProvider.getProviderNo());

  	if(request.getParameter("specs.id") != null && request.getParameter("specs.id").length()>0) {
  		specs.setId(Integer.parseInt(request.getParameter("specs.id")));
  	}

  	if(specs.getId() != null && specs.getId() == 0) {
  		specs.setId(null);
  	}
  	specs.setUpdateTime(new Date());

  	if(specs.getId() == null) {
  		dao.persist(specs);
  	} else {
  		dao.merge(specs);
  	}


if (request.getParameter("json") != null && request.getParameter("json").equalsIgnoreCase("true")) {
	HashMap<String, Integer> hashMap = new HashMap<String, Integer>();
	hashMap.put("saved", specs.getId());

	JSONObject json = JSONObject.fromObject(hashMap);
	response.getOutputStream().write(json.toString().getBytes());

	return null;
}

  	request.setAttribute("parentAjaxId", "specshistory");
  	return mapping.findForward("success");
  }
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:39,代码来源:SpecsHistoryAction.java

示例14: saveConRequest

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward saveConRequest(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
	log.info("saveConRequest");
          ConsultationReportDao dao = (ConsultationReportDao)SpringUtils.getBean("consultationReportDao");

          DynaValidatorForm crForm = (DynaValidatorForm) form;
          EyeformConsultationReport cp = (EyeformConsultationReport) crForm.get("cp");
          EyeformConsultationReport consultReport = null;
          
          //Integer id=cp.getId();
      	Integer id = null;
	if(request.getParameter("cp.id")!=null && request.getParameter("cp.id").trim().length()>0)
		id = Integer.parseInt(request.getParameter("cp.id").trim());
	else
		id=cp.getId();
	
	if(id != null && id.intValue()>0 ) {
		consultReport = dao.find(id);
	} else {
		consultReport = new EyeformConsultationReport();
		
	}
	//BeanUtils.copyProperties(cp, consultReport, new String[]{"id","demographic","provider"});			
	BeanUtils.copyProperties(cp, consultReport, new String[]{"id"});
         
          ProfessionalSpecialist professionalSpecialist = professionalSpecialistDao.getByReferralNo(cp.getReferralNo());
	if (professionalSpecialist != null)
		consultReport.setReferralId(professionalSpecialist.getId());

	consultReport.setDate(new Date());
	
	dao.merge(consultReport);
	
	request.setAttribute("cpId", consultReport.getId().toString());
	request.setAttribute("savedflag", "saved");
	//return prepareConReport(mapping, form, request, response);
	request.setAttribute("parentAjaxId", "conReport");
	return mapping.findForward("success");
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:39,代码来源:EyeformAction.java

示例15: save

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
  	DynaValidatorForm f = (DynaValidatorForm)form;
  	EyeformOcularProcedure procedure = (EyeformOcularProcedure)f.get("proc");

  	OcularProcDao dao = (OcularProcDao)SpringUtils.getBean("ocularProcDao");
  	procedure.setProvider(LoggedInInfo.loggedInInfo.get().loggedInProvider.getProviderNo());

  	if(request.getParameter("proc.id") != null && request.getParameter("proc.id").length()>0) {
  		procedure.setId(Integer.parseInt(request.getParameter("proc.id")));
  	}

  	if(procedure.getId() != null && procedure.getId() == 0) {
  		procedure.setId(null);
  	}
  	procedure.setUpdateTime(new Date());

  	if(procedure.getId() == null) {
  		dao.persist(procedure);
  	} else {
  		dao.merge(procedure);
  	}

  	if (request.getParameter("json") != null && request.getParameter("json").equalsIgnoreCase("true")) {
	HashMap<String, Integer> hashMap = new HashMap<String, Integer>();
	hashMap.put("saved", procedure.getId());

	JSONObject json = JSONObject.fromObject(hashMap);
	response.getOutputStream().write(json.toString().getBytes());

	return null;
}

  	request.setAttribute("parentAjaxId", "ocularprocedure");
  	return mapping.findForward("success");
  }
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:36,代码来源:OcularProcAction.java


注:本文中的org.apache.struts.validator.DynaValidatorForm.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。