package com.sishuok.architecture1;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import com.sishuok.architecture1.customermgr.service.ICustomerService;
import com.sishuok.architecture1.customermgr.vo.CustomerModel; @Controller
@RequestMapping("/")
public class LoginController {
@Autowired
private ICustomerService ics = null; @RequestMapping(value="/toLogin",method=RequestMethod.GET)
public String toLogin(){
return "login";
}
@RequestMapping(value="/login",method=RequestMethod.POST)
public String login(@RequestParam("customerId")String customerId
,@RequestParam("pwd")String pwd,HttpServletResponse response){ if(customerId==null || customerId.trim().length()==0){
return "login";
}
ics.getByUuid(1);
CustomerModel cm = ics.getByCustomerId(customerId); if(cm==null || cm.getUuid()<=0){
return "login";
} Cookie c = new Cookie("MyLogin",cm.getUuid()+","+System.currentTimeMillis());
response.addCookie(c); return "redirect:/toIndex";
}
}

主要是关于登录界面的Java代码

Java高级架构师(一)第25节:实现前端的业务登录等功能的更多相关文章

  1. Java高级架构师(一)第01节:整体课程概览

    本课程专注于构建:高可扩展性.高性能.大数据量.高并发.分布式的系统架构. 从零开始.全面系统.成体系的软件架构课程,循序渐进的讲述构建上述系统架构所需要的各种技术知识和技能. 适应人群: 1:有一定 ...

  2. 好好讲一讲,到底什么是Java高级架构师!

    一. 什么是架构师 曾经有这么个段子: 甲:我已经应聘到一家中型软件公司了,今天上班的时候,全公司的人都来欢迎我. 乙:羡慕ing,都什么人来了? 甲:CEO.COO.CTO.All of 程序员,还 ...

  3. JAVA高级架构师基础功:Spring中AOP的两种代理方式:动态代理和CGLIB详解

    在spring框架中使用了两种代理方式: 1.JDK自带的动态代理. 2.Spring框架自己提供的CGLIB的方式. 这两种也是Spring框架核心AOP的基础. 在详细讲解上述提到的动态代理和CG ...

  4. Java高级架构师(一)第42节:应用上Nginx过后的体系结构

    以后的架构思考方向: 体系结构的演变

  5. Java高级架构师(一)第31节:Nginx简介、安装和基本运行

    第一节:主要介绍Nginx和安装

  6. Java高级架构师(一)第28节:Index、商品详细页和购物车

    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding= ...

  7. Java高级架构师(一)第26节:测试并调整登录的业务功能

    主Index的处理Java: package com.sishuok.architecture1; import org.springframework.beans.factory.annotatio ...

  8. Java高级架构师(一)第19节:X-gen生成相应的Visitor

    package cn.javass.themes.smvcsm.visitors; import cn.javass.xgen.genconf.vo.ExtendConfModel; import c ...

  9. Java高级架构师(一)第16节:Mybatis动态查询和Json自动拼装

    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding= ...

随机推荐

  1. java+ssh+eclipse开发过程问题记录

    原文 http://www.sdfengxi.com/?p=408   最近在忙着的项目是基于cloudstack平台的管理平台,因为CloudStack使用java开发,管理机上已部署好rhel+t ...

  2. 图论:Stoer-Wagner算法

    利用Stoer-Wagner算法求无向图最小割 直接给出算法描述和过程实现: 算法步骤: . 设最小割cut=INF, 任选一个点s到集合A中, 定义W(A, p)为A中的所有点到A外一点p的权总和. ...

  3. NOIP2005过河(青蛙过河)

    题目传送门 这道题主要是因为L长度最大可以为1e9 而石子却最多只有100个 这样就浪费了很多时间空间 所以我们压缩一波路径就可以了 剩余的就是枚举每个点以及i-y到i-x的dp了 这里要说一句为什么 ...

  4. Android USB Camera(1) : 调试记录【转】

    转自:http://blog.csdn.net/eternity9255/article/details/53069037 版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[-] 前言 ...

  5. HDU-3320

    Alice’s Cube Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  6. poj 1654(利用叉积求面积)

    Area Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 17937   Accepted: 4957 Description ...

  7. python2.7.12自带pip吗?

    是的,在安装python2.7.12时自带pip安装包,可以在python安装包Scripts下面可以看到.

  8. AC日记——[SHOI2008]小约翰的游戏John bzoj 1022

    1022 思路: nim: 代码: #include <cstdio> #include <cstdlib> #include <iostream> #includ ...

  9. Unity3D实现DoubleClick的一种方法

    代码简单粗暴如下: void OnMouseDown() { ) { t2 = DateTime.Now; , , , , )) //时间间隔小于500ms,认为是双击 { // 双击后的操作 } t ...

  10. 【转】jmeter入门教程- Jmeter教程及技巧汇总

    https://blog.csdn.net/zouxiongqqq/article/details/72843500