分享一个SSH项目实例

2025-10-26
网站建设限时活动促销

 一、用户注册

   

 

二、登陆校验拦截器

  1.拦截器

public class PrivilegeInterceptor extends MethodFilterInterceptor {    @Override//不校验登陆和注册方法protected String doIntercept(ActionInvocation invocation) throws Exception {//1 获得SessionMap session = ActionContext.getContext().getSession();//2 获得登陆标识User user = (User) session.get("user");//3 判断标识是否存在if(user != null){//存在=> 放行return invocation.invoke();            }else{//不存在=> 重定向到登陆页面return "toLogin";            }        }}

  2.struts.xml

        login,regist/login.jsp

 

三、员工拜访客户功能

  1.表|实体设计

   

 

   

  2.客户拜访记录添加

   

   时间控件在jsp的运用:

<script><script><script><script>$(document).ready(function(){ // yy 已经代表了4位的年份 // mm 代表月份 // dd 代表日期 $('#visit_time').datepick({dateFormat: 'yy-mm-dd'}); $('#visit_nexttime').datepick({dateFormat: 'yy-mm-dd'}); });

  3.客户拜访记录列表

   作业:再增加一个查询条件,就是根据业务员来查询

  4.客户拜访记录修改

   

 

四、MD5加密

   

public class MD5Utils {public static String md5(String plainText) {byte[] secretBytes = null;try {            secretBytes = MessageDigest.getInstance("md5").digest(                    plainText.getBytes());        } catch (NoSuchAlgorithmException e) {throw new RuntimeException("没有md5这个算法!");        }        String md5code = new BigInteger(1, secretBytes).toString(16);// 16进制数字// 如果生成数字未满32位,需要前面补0for (int i = 0; i 

标签: ssh框架项目实例

本文地址:https://www.lifejia.cn/news/205548.html

免责声明:本站内容仅用于学习参考,信息和图片素材来源于互联网,如内容侵权与违规,请联系我们进行删除,我们将在三个工作日内处理。联系邮箱:cloudinto#qq.com(把#换成@)