在学习shiro的途中,在github发现了一个开源项目,所需的控件刚好是自己要学习的方向.

虽然还要学习完ssm的shiro与springboot的shiro,以及接下来的种种控件和类库,但学习这个开源项目刻不容缓

[SSM的shiro使用]

SSM简单的说,就是SpringMVC负责web部分,mybatis负责数据库部分,否则没有mybatis要写的jdbc是很费时间的.

所以基于ssm的shiro项目,就是Servlet部分修改为SpringMVC,数据库部分,修改为Mybatis,然后把shiro集成进去,用这样一个思路来把项目实现.

老式Servlet:

package com.ykmimi.gobang.servlet;import java.io.IOException;
import java.io.PrintWriter;import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;/**
* Servlet implementation class LognServlet
*/
@WebServlet(description = "五子棋登陆", urlPatterns = { "/login" })
public class LoginServlet extends HttpServlet {
private static final long serialVersionUID = 1L; /**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=utf-8");
request.setCharacterEncoding("utf-8");
/////* 获取用户名和密码
String username = request.getParameter("username");
String password = request.getParameter("password");
PrintWriter pw = response.getWriter();
if(username.equals("admin") && password.equals("admin")) {
pw.print("登陆成功!
05-14 12:36