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


Java DefaultHandler类代码示例

本文整理汇总了Java中net.sourceforge.stripes.action.DefaultHandler的典型用法代码示例。如果您正苦于以下问题:Java DefaultHandler类的具体用法?Java DefaultHandler怎么用?Java DefaultHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: subscribe

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
@HandlesEvent("subscribe")
public Resolution subscribe() {
    if (!antiSpamHelper.checkRequestCounter("contact")) {
        return json("{}");
    }

    System.out.println("[Newsletter subscription] = " + email);
    if (email != null) {
        newsSubscriberService.subscribe(email, "NEWS_SUBSCR", null);
    }

    app.publish("newsletter:subscription",
        Context.create("email", email, "action", "subscribe").setResponseListener(new ResponseListener() {
            @Override
            public void onResponse(Object response) {
            }
        }));

    return json("{}");
}
 
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:22,代码来源:NewsSubscriptionAction.java

示例2: form

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution form() {
	if (getParam("id")==null) {
		account = new AccountingAccount();
		account.setActive(true);
	} else {
		try {
    		  connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
    		  setId(getParam("id"));
    		  setAccountingAccount(new AccountingAccount(getSession().getDms(), getId()));
    		  disconnect();
    	  } catch (Exception xcpt) {
    		  Log.out.error(xcpt.getMessage(), xcpt);
    	  } finally {
    		  close();
    	  }			
	}
	setTaxPayer(getParam("taxpayer",""));	  
	return new ForwardResolution(FORM);
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:21,代码来源:EditAccountingAccount.java

示例3: form

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution form() {
	if (getParam("id")==null) {
		emplyee = new Employee();
	} else {
		try {
    		  connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
    		  setId(getParam("id"));
    		  setEmployee(new Employee(getSession().getDms(), getId()));
    		  setTaxPayer(getParam("taxpayer",""));	    			  
    		  disconnect();
    	  } catch (Exception xcpt) {
    		  Log.out.error(xcpt.getMessage(), xcpt);
    	  } finally {
    		  close();
    	  }			
	}
	return new ForwardResolution(FORM);
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:20,代码来源:EditEmployee.java

示例4: archive

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution archive() {
	final String sId = getParam("id");
	if (getErrorsCount()==0) {
		try {
			connect();
			Message oMsg = new Message(getSession().getDms(), sId);
			oMsg.archive(getSession());
			disconnect();
    		addDataLine("id",oMsg.id());
		} catch (Exception xcpt) {
			Log.out.error(xcpt.getMessage(), xcpt);
			addError(new SimpleError(xcpt.getMessage()));
		} finally {
			close();
		}
	}
    return AjaxResponseResolution();
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:20,代码来源:ArchiveMessage.java

示例5: form

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution form() {

	final String id = getParam("id","");

	try {
 		    connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
 		    Dms oDms = getSession().getDms();
		Client clnt = new Client(oDms, id);
		if (clnt.invoicesCount(oDms)>0)
			addError(new LocalizableError("com.zesped.action.CheckCanDeleteClient.hasInvoices",clnt.getBusinessName()));
		else if (clnt.ticketsCount(oDms)>0)
			addError(new LocalizableError("com.zesped.action.CheckCanDeleteClient.hasTickets",clnt.getBusinessName()));
		disconnect();
    } catch (Exception xcpt) {
    	Log.out.error("CheckCanDeleteClient.form() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
    } finally {
    	close();
    }

	return AjaxResponseResolution();
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:23,代码来源:CheckCanDeleteClient.java

示例6: form

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution form() {

	final String txpr = getParam("taxpayer","");

	try {
		connect();
		taxpr = new TaxPayer(getSession().getDms(), txpr);
		accounts = taxpr.accounts(getSession()).list(getSession());
		disconnect();
    } catch (Exception xcpt) {
    	Log.out.error(xcpt.getMessage(), xcpt);
    } finally {
    	close();
    }

	return new ForwardResolution(FORM);
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:19,代码来源:ListAccounts.java

示例7: form

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution form() {

	final String txpr = getParam("taxpayer","");

	try {
		connect();
		TaxPayer taxpr = new TaxPayer(getSession().getDms(), txpr);
		taxpr.refreshCounters(getSession());
		taxpr.save(getSession());
		bizname = taxpr.getBusinessName();
		pending = taxpr.getPendingInvoicesCount();
		processed = taxpr.getProcessedInvoicesCount();
		approved = taxpr.getApprovedInvoicesCount();
		total = taxpr.getTotalInvoicesCount();
		disconnect();
    } catch (Exception xcpt) {
    	Log.out.error("CountInvoices.form() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
    } finally {
    	close();
    }

	return new ForwardResolution(FORM);
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:25,代码来源:CountInvoices.java

示例8: form

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution form() {
	Log.out.debug("Begin ListMessages.form()");
	iFolder = Integer.parseInt(getParam("f","0"));
	sSort = getParam("s","sent_date");
	bAsc = getParam("a","0").equals("1");	
	iOffset = Integer.parseInt(getParam("o","0"));
	iMaxMsgs = Integer.parseInt(getParam("m","20"));
	try {			
 		  connect();
 		  oMsgs = Messages.list(getSession(), getSessionAttribute("user_uuid"), iFolder, iOffset, iMaxMsgs, sSort, bAsc);
 		  disconnect();
 	    } catch (Exception xcpt) {
 		  Log.out.error(xcpt.getMessage(), xcpt);
 	    } finally {
 		  close();
 	    }
	Log.out.debug("End ListMessages.form()");
	return new ForwardResolution(FORM);
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:21,代码来源:ListMessages.java

示例9: form

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution form() {

	final String id = getParam("id","");

	try {
 		    connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
 		    Dms oDms = getSession().getDms();
 		    AccountingAccount oAacc = new AccountingAccount(oDms, id);
 		    SortableList<Document> oTcks = oDms.query("Ticket$accounting_uuid='"+oAacc.getUuid()+"'");
		if (!oTcks.isEmpty()) {
			addError(new LocalizableError("com.zesped.action.CheckCanDeleteAccountingAccount.hasTickets"));				
		}
		disconnect();
    } catch (Exception xcpt) {
    	Log.out.error("CheckCanDeleteAccountingAccount.form() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
    } finally {
    	close();
    }

	return AjaxResponseResolution();
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:23,代码来源:CheckCanDeleteAccountingAccount.java

示例10: ping

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution ping() throws Exception {
	final String sNickName = getSessionAttribute("nickname");
	final String sPassword = getSessionAttribute("password");
	if (sNickName==null || sPassword==null) {
		return new JavaScriptResolution("expiredsession");
	} else {
		try {
			connect (sNickName, sPassword);
			disconnect();
			return new JavaScriptResolution("");
		} catch (Exception xcpt) {
			return new JavaScriptResolution("passwordmismatch");
		} finally {
			close();
		}
	} // fi
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:19,代码来源:SessionPing.java

示例11: archive

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution archive() {
	final String sId = getParam("id");
	final String sUid = getSessionAttribute("user_uuid");
	if (getErrorsCount()==0) {
		try {
			connect();
			Message oMsg = new Message(getSession().getDms(), sId);
			if (oMsg.getStringNull("sender_id", "").equals(sUid) || oMsg.getStringNull("recipient_id", "").equals(sUid))
				Message.delete(getSession(), sId);
			disconnect();
    		addDataLine("id",sId);
		} catch (Exception xcpt) {
			Log.out.error(xcpt.getMessage(), xcpt);
			addError(new SimpleError(xcpt.getMessage()));
		} finally {
			close();
		}
	}
    return AjaxResponseResolution();
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:22,代码来源:DeleteMessage.java

示例12: form

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution form() {

	final String txpr = getParam("taxpayer","");

	try {
		connect();
		TaxPayer taxpr = new TaxPayer(getSession().getDms(), txpr);
		taxpr.refreshCounters(getSession());
		taxpr.save(getSession());
		bizname = taxpr.getBusinessName();
		pending = taxpr.getPendingTicketsCount();
		processed = taxpr.getProcessedTicketsCount();
		settled = taxpr.getSettledTicketsCount();
		total = taxpr.getTotalTicketsCount();
		disconnect();
    } catch (Exception xcpt) {
    	Log.out.error("CountTickets.form() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
    } finally {
    	close();
    }

	return new ForwardResolution(FORM);
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:25,代码来源:CountTickets.java

示例13: form

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution form() {
	id = getParam("id");
	action = getParam("a","r").equals("f") ? "forward" : "reply";
	try {
		connect();
		setMessage(new Message(getSession().getDms(), id));
		CustomerAccount cac = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
		recipients = cac.getUsers(getSession());
		disconnect();
    } catch (Exception xcpt) {
    	Log.out.error(xcpt.getMessage(), xcpt);
    } finally {
    	close();
    }
	return new ForwardResolution(FORM);
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:18,代码来源:ReplyMessage.java

示例14: send

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution send() {
	final String sId = getParam("id");
	final String sThreadId = getParam("threadId");
	final String sReciptId = getParam("recipient");
	final String sSubject = getParam("subject");
	final String sBody = getParam("body");
	if (getErrorsCount()==0) {
		try {
			connect();
			User oMe = new User(getSession(), getSessionAttribute("user_docid"));
			User oRe = new User(getSession(), User.forUuid(sReciptId));
			Message oMsg = Messages.reply(getSession(), sThreadId,
										  oMe.getFullName(), oMe.getEmail(), oMe.getNickName(),
					       				  oRe.getEmail(), oRe.getNickName(), sSubject, sBody);
			disconnect();
    		addDataLine("id",oMsg.id());
		} catch (Exception xcpt) {
			Log.out.error(xcpt.getMessage(), xcpt);
			addError(new SimpleError(xcpt.getMessage()));
		} finally {
			close();
		}
	}
    return AjaxResponseResolution();
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:27,代码来源:SendMessage.java

示例15: form

import net.sourceforge.stripes.action.DefaultHandler; //导入依赖的package包/类
@DefaultHandler
public Resolution form() {
	
	new SendDelayedMail(getSessionAttribute("fullname"), getSessionAttribute("email"), getSessionAttribute("user_docid"), getSessionAttribute("user_uuid"), 90000l).start();
	
	removeSessionAttribute("nickname");
	removeSessionAttribute("password");
	removeSessionAttribute("fullname");
	removeSessionAttribute("businessname");
	removeSessionAttribute("user_uuid");
	removeSessionAttribute("user_docid");
	removeSessionAttribute("customer_acount");
	removeSessionAttribute("customer_account_docid");
	removeSessionAttribute("taxpayer_docid");
	removeSessionAttribute("employee_uuid");
	removeSessionAttribute("taxpayer_docid");
	removeSessionAttribute("role");

	return new ForwardResolution(FORM);
}
 
开发者ID:sergiomt,项目名称:zesped,代码行数:21,代码来源:SignUpConfirmation.java


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