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


Java DynaValidatorForm.set方法代码示例

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


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

示例1: unspecified

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
	List<CssStyle>styles = cssStylesDao.findAll();
	
	DynaValidatorForm frm = (DynaValidatorForm)form;		
	frm.set("styles", styles);
	frm.set("styleText", "");
	frm.set("selectedStyle", "-1");
	frm.set("editStyle", "-1");
	return mapping.findForward("init");		
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:11,代码来源:ManageCSSAction.java

示例2: 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

示例3: save

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	DynaValidatorForm frm = (DynaValidatorForm)form;
	String style = (String)frm.get("editStyle");
	String selectedStyle = (String)frm.get("selectedStyle");
	CssStyle cssStyle = null;
	boolean newStyle = false;
	List<CssStyle>styles = cssStylesDao.findAll();;
	
	if( selectedStyle.equals("-1") ) {
		cssStyle = new CssStyle();
		cssStyle.setStatus(CssStyle.ACTIVE);
		newStyle = true;
	}
	else {			
		for( CssStyle cssStylecurrent: styles ) {
			if( cssStylecurrent.getStyle().equalsIgnoreCase(style)) {
				cssStyle = cssStylecurrent;
				break;
			}
		}
		
	}
	
	cssStyle.setName(frm.getString("styleName"));
	cssStyle.setStyle(frm.getString("styleText"));
	
	if( newStyle ) {
		cssStylesDao.persist(cssStyle);
		styles.add(cssStyle);
	}
	else {
		cssStylesDao.merge(cssStyle);
	}
	
	frm.set("styles", styles);
	request.setAttribute("success", "true");
	
	return mapping.findForward("init");
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:40,代码来源:ManageCSSAction.java

示例4: delete

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	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:oscarservice,项目名称:oscar-old,代码行数:28,代码来源:ManageCSSAction.java

示例5: clearPublication

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public PublicationBean clearPublication() {
	WebContext wctx = WebContextFactory.get();
	DynaValidatorForm form = (DynaValidatorForm) wctx.getSession()
			.getAttribute("publicationForm");
	PublicationBean pbean = new PublicationBean();
	if (form != null) {
		form.set("publication", pbean);
	}
	return pbean;
}
 
开发者ID:NCIP,项目名称:camod,代码行数:11,代码来源:DWRPublicationManager.java

示例6: save

import org.apache.struts.validator.DynaValidatorForm; //导入方法依赖的package包/类
public ActionForward save(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");
	String selectedStyle = (String)frm.get("selectedStyle");
	CssStyle cssStyle = null;
	boolean newStyle = false;
	List<CssStyle>styles = cssStylesDao.findAll();;
	
	if( selectedStyle.equals("-1") ) {
		cssStyle = new CssStyle();
		cssStyle.setStatus(CssStyle.ACTIVE);
		newStyle = true;
	}
	else {			
		for( CssStyle cssStylecurrent: styles ) {
			if( cssStylecurrent.getStyle().equalsIgnoreCase(style)) {
				cssStyle = cssStylecurrent;
				break;
			}
		}
		
	}
	
	cssStyle.setName(frm.getString("styleName"));
	cssStyle.setStyle(frm.getString("styleText"));
	
	if( newStyle ) {
		cssStylesDao.persist(cssStyle);
		styles.add(cssStyle);
	}
	else {
		cssStylesDao.merge(cssStyle);
	}
	
	frm.set("styles", styles);
	request.setAttribute("success", "true");
	
	return mapping.findForward("init");
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:46,代码来源:ManageCSSAction.java


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