本文整理汇总了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");
}
示例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");
}
示例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");
}
示例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");
}
示例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;
}
示例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");
}