资源简介


资源截图

代码片段和文件信息

/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.hygj.action;

import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.actions.DispatchAction;

import sun.awt.embeddedframe;

import com.hygj.bean.EmailBean;
import com.hygj.bean.UsersBean;
import com.hygj.dao.SendedDAOINF;
import com.hygj.dao.impl.SendedDAOImpl;
import com.hygj.email.EmailService;

import com.hygj.service.InfoServiceINF;
import com.hygj.service.impl.InfoServiceImpl;
import com.sun.java_cup.internal.emit;

/** 
 * MyEclipse Struts
 * Creation date: 04-30-2009
 * 
 * XDoclet definition:
 * @struts.action parameter=“method“ validate=“true“
 */
public class InfoAction extends DispatchAction {
/*
 * Generated Methods
 */

/** 
 * 功能:验证用户
 * Method execute
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return ActionForward
 */
public ActionForward checkLogin(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {

DynaActionForm dn = (DynaActionForm) form;

UsersBean users = new UsersBean();

users.setUsername(dn.get(“username“).toString());
users.setPassword(dn.get(“password“).toString());

InfoServiceINF info = new InfoServiceImpl();

UsersBean user = info.checkLogin(users);

if(user.getId()>0)
{
request.getSession().setAttribute(“user“ user);
return mapping.findForward(“main“);
}
else
{
return new ActionForward(“/index.jsp“);
}
}
/******
 * 功能:发送Email
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return
 */
public ActionForward sendedMail(ActionMapping mapping ActionForm form
HttpServletRequest request HttpServletResponse response) {
try {
request.setCharacterEncoding(“GBK“);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

DynaActionForm dn = (DynaActionForm) form;

Calendar   cl=Calendar.getInstance();     //获取日期
SimpleDateFormat sdf = new SimpleDateFormat(“yyyy-MM-dd  HH:mm:ss“);  
String   thetime   =   sdf.format(cl.getTime()); 

UsersBean ub = (UsersBean)(request.getSession().getAttribute(“user“) != null ? request.getSession().getAttribute(“user“) : ““);

EmailBean email = new EmailBean();

email.setHost(“smtp.sohu.com“);
email.setUsername(ub.getUsername());
email.setPassword(ub.getPassword());
email.setSender(dn.get(“fajianren“).toString());
email.setRecipients(dn.get(“shoujianren“).

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1756  2009-05-11 17:12  MyMail\.classpath

     文件        291  2009-05-11 17:12  MyMail\.mymetadata

     文件        262  2009-04-29 19:01  MyMail\.mystrutsdata

     文件       1307  2009-04-29 19:04  MyMail\.project

     文件    1048576  2009-05-11 20:12  MyMail\MyEmail_Data.MDF

     文件    1048576  2009-05-11 20:12  MyMail\MyEmail_Log.LDF

     文件      13079  2009-05-11 19:51  MyMail\src\com\hygj\action\InfoAction.java

     文件       1654  2009-05-10 23:31  MyMail\src\com\hygj\bean\EmailBean.java

     文件        489  2009-04-29 21:36  MyMail\src\com\hygj\bean\UsersBean.java

     文件        451  2009-05-11 18:38  MyMail\src\com\hygj\dao\DeleteDAOINF.java

     文件        161  2009-05-11 02:38  MyMail\src\com\hygj\dao\DeleteEmail.java

     文件       2252  2009-05-11 18:39  MyMail\src\com\hygj\dao\impl\DeleteDAOImpl.java

     文件        871  2009-05-11 02:52  MyMail\src\com\hygj\dao\impl\DeleteEmailDAOImpl.java

     文件       1956  2009-05-11 03:00  MyMail\src\com\hygj\dao\impl\SelectCaoDAOImpl.java

     文件       2660  2009-05-11 03:01  MyMail\src\com\hygj\dao\impl\SelectGetsDAOImpl.java

     文件       3352  2009-05-11 03:00  MyMail\src\com\hygj\dao\impl\SelectMoreDAOImpl.java

     文件       1371  2009-05-11 02:59  MyMail\src\com\hygj\dao\impl\SelectSendedDAOImpl.java

     文件       1865  2009-05-11 02:05  MyMail\src\com\hygj\dao\impl\SendedDAOImpl.java

     文件       1874  2005-04-22 16:24  MyMail\src\com\hygj\dao\impl\UpdateEmailDAOImpl.java

     文件       1156  2009-04-30 17:01  MyMail\src\com\hygj\dao\impl\UsersDAOImpl.java

     文件        256  2009-05-06 22:12  MyMail\src\com\hygj\dao\SelectCaoDAOINF.java

     文件        588  2009-05-06 17:31  MyMail\src\com\hygj\dao\SelectGetsDAOINF.java

     文件        749  2009-05-06 17:31  MyMail\src\com\hygj\dao\SelectMoreDAOINF.java

     文件        293  2009-05-06 17:31  MyMail\src\com\hygj\dao\SelectSendedDAOINF.java

     文件        304  2009-05-11 01:46  MyMail\src\com\hygj\dao\SendedDAOINF.java

     文件        453  2005-04-22 16:24  MyMail\src\com\hygj\dao\UpdateEmailDAOINF.java

     文件        228  2009-04-30 17:26  MyMail\src\com\hygj\dao\UsersDAOINF.java

     文件        698  2009-04-29 10:38  MyMail\src\com\hygj\db\DbUtil.java

     文件       5974  2009-05-11 19:52  MyMail\src\com\hygj\email\EmailService.java

     文件       7106  2009-05-11 20:07  MyMail\src\com\hygj\service\impl\InfoServiceImpl.java

............此处省略280个文件信息

评论

共有 条评论