快速业务通道

Struts开发指南之工作流程 - 编程入门网

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-06-22
word; } public String getType() { return (this.type); } public void setType(String type) { this.type = type; } public String getUsername() { return (this.username); } public void setUsername(String username) { this.username = username; } /** * Reset all properties to their default values. * * @param mapping The mapping used to select this instance * @param request The servlet request we are processing */ public void reset(ActionMapping mapping, HttpServletRequest request) {   this.action = "Create";   this.autoConnect = false;   this.host = null;   this.password = null;   this.type = null;   this.username = null; } /** * Validate the properties that have been set from this HTTP request, * and return an <code>ActionErrors</code> object that encapsulates any * validation errors that have been found. If no errors are found, return * <code>null</code> or an <code>ActionErrors</code> object with no * recorded error messages. * * @param mapping The mapping used to select this instance * @param request The servlet request we are processing */ public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {   ActionErrors errors = new ActionErrors();   if ((host == null) || (host.length() < 1))    errors.add("host",    new ActionError("error.host.required"));   if ((username == null) || (username.length() < 1))    errors.add("username",    new ActionError("error.username.required"));   if ((password == null) || (password.length() < 1))    errors.add("password",    new ActionError("error.password.required"));   if ((type == null) || (type.length() < 1))    errors.add("type",    new ActionError("error.type.required"));   else if (!"imap".equals(type) && !"pop3".equals(type))    errors.add("type",new ActionError("error.type.invalid", type));   return (errors);   } }

Struts开发指南之工作流程(4)

时间:2010-12-15

logonAction

public final class LogonAction extends Action { /** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another web component that will create it). * Return an <code>ActionForward</code> instance describing where and how * control should be forwarded, or <code>null</code> if the response has * already been completed. * * @param mapping The ActionMapping used to select this instance * @param form The optional ActionForm bean for this request (if any) * @param request The HTTP request we are processing * @param response The HTTP response we are creating * * @exception Exception if business logic throws an exception */ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {   // Extract attributes we will need   Locale locale = getLocale(

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号