长时间不写,知识都淡忘了!现在实现简单登录注册功能,供以后参考!!!!
项目下载地址:
https://github.com/majunm/TestServiceDemo.git
服务器: Tomcat/7.0.40 数据库: mysql5.0
数据库创建: mysql 正确安装 配置完path 后 如下界面:
mysql -u root -p // 连接mysql数据库
create database july;//创建数据库 数据库名 july
show databases; // 查看数据库
show create database july; //查看数据库创建详情use july;// 使用 july 数据库
---------------创建表---------------------
create table user(
id int primary key auto_increment ,
username varchar(80),
password varchar(200)
);---------------创建表---------------------
show tables; // 查看july 数据库中的表
desc user;//查看user表的信息
MYSQL可视化工具:
=========================服务端代码=======================
访问路径:
http://localhost:8080/TestServiceDemo/http://localhost:8080/TestServiceDemo/register.jsp//跳转到注册界面,填写表单 提交跳转到 http://localhost:8080/TestServiceDemo/register
http://localhost:8080/TestServiceDemo/register // 对应 register servlet
http://localhost:8080/TestServiceDemo/login.jsp
http://localhost:8080/TestServiceDemo/login// 同上
路径 配置 以 web.xml 为准!!!!!!!!!!
代码组织结构如下: