Package com.etown.action

Source Code of com.etown.action.CheckCodeAction

/**
*
*/
package com.etown.action;

import nl.captcha.Captcha;
import nl.captcha.servlet.CaptchaServletUtil;

/**
* @author Administrator
* 获取验证码信息
*/
@SuppressWarnings("serial")
public class CheckCodeAction extends BaseAction {
  /**
   * 取得验证码
   */
  public void getImg() throws Exception
  {
    Captcha captcha = (new nl.captcha.Captcha.Builder(200, 50)).addText().addBackground().addNoise().build();
    CaptchaServletUtil.writeImage(super.response, captcha.getImage());
    getSession().setAttribute("simpleCaptcha", captcha);
  }
}
TOP

Related Classes of com.etown.action.CheckCodeAction

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.