java测试
//信1705-1 20173527 刘津鑫
package money;
import java.io.IOException;
import java.io.Serializable;
import java.util.Scanner;
import java.util.ArrayList;
public class Account implements Serializable{
private String accountID;//账户
private String accountname;//姓名
private String operatedate;//时间
private int operatetype;//操作类型
private String accountpassword;//密码
private int accountbalance;//余额
private int amount;//流水金额
public String getaccountID()
{
return accountID;
}
public String getaccountname()
{
return accountname;
}
public String getoperatedate()
{
return operatedate;
}
public int getoperatetype()
{
return operatetype;
}
public String getaccountpassword()
{
return accountpassword;
}
public int getaccountbalance()
{
return accountbalance;
}
public int getamount()
{
return amount;
}
public void setaccountID(String accountID)
{
this.accountID=accountID;
}
public void setaccountname(String accountname)
{
this.accountname=accountname;
}
public void setoperatedate(String operatedate)
{
this.operatedate=operatedate;
}
public void setoperatetype(int operatetype)
{
this.operatetype=operatetype;
}
public void setaccountpassword(String accountpassword)
{
this.accountpassword=accountpassword;
}
public void setaccountbalance(int accountbalance)
{
this.accountbalance=accountbalance;
}
public void setamount(int amount)
{
this.amount=amount;
}
public Account() {
}
public String tostring() {
return "id="+accountID+",accountname="+accountname+",accountpassword="+accountpassword+",accountbalance="+accountbalance;
}
public String tostring1() {
return "id="+accountID+",accountname="+accountname+",operatedate="+operatedate+",operatetype="+operatetype+",aamount="+amount;
}
public Account(String accountID,String accountname,String operatedate,int operatetype,String accountpassword,int accountbalance,int amount) {
this.accountID=accountID;
this.accountname=accountname;
this.operatedate=operatedate;
this.operatetype=operatetype;
this.accountpassword=accountpassword;
this.accountbalance=accountbalance;
this.amount=amount;
}
public static void main(String[] args) throws IOException
{
AccountManager a=new AccountManager();
ArrayList<Account> people=new ArrayList<Account>();
ArrayList<Account> list=new ArrayList<Account>();
/* for(int i=0;i<5;i++)
{
a.addAccount(people);
}*/
a.show(people);
a.enterID(people,list);
}
}
//信1705-1 20173527 刘津鑫
package money;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Date;
public class AccountManager {
public void addAccount(ArrayList<Account> people)
{
Scanner in = new Scanner(System.in);
Account ac=new Account();
System.out.println("请输入账户的账号、名称、密码、账户余额");
String accountID=in.next();
String accountname=in.next();
String accountpassword=in.next();
int accountbalance=in.nextInt();
ac.setaccountID(accountID);
ac.setaccountname(accountname);
ac.setaccountpassword(accountpassword);
ac.setaccountbalance(accountbalance);
people.add(ac);
File file = new File("accountinformation.txt");
// 对象输出流
ObjectOutputStream out = null;
try {
// 将数组对象写入文件
out = new ObjectOutputStream(new FileOutputStream(file));
out.writeObject(people);
out.flush();
out.close();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public void show(ArrayList<Account> people)
{
File file = new File("accountinformation.txt");
ObjectInputStream in = null;
try {
in = new ObjectInputStream(new FileInputStream(file));
people = (ArrayList<Account>) in.readObject();
for (int i=0;i<people.size();i++) {
Account s=people.get(i);
System.out.println(s.tostring());
}
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
public void enterID(ArrayList<Account> people,ArrayList<Account> list)
{
int a=1;
int flag=-1;
while(a==1) {
System.out.println("**************************************************");
System.out.println(" 欢迎使用中国工商银行自动柜员系统");
System.out.println("请输入您的账号:");
Scanner in = new Scanner(System.in);
String ID=in.next();
if(ID.length()!=8)
{
System.out.println("该卡不是工行卡");
a=1;
}
File file = new File("accountinformation.txt");
ObjectInputStream oin = null;
try {
oin = new ObjectInputStream(new FileInputStream(file));
people = (ArrayList<Account>) oin.readObject();
for (int i=0;i<people.size();i++) {
Account s=people.get(i);
if(s.getaccountID().equals(ID))
{
flag=i;a=1;
}
}
if(flag==-1)
{
System.out.println("该账号不存在");
}
else
{
a=2;
}
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
enterpassword(people,flag,list);
}
public void enterpassword(ArrayList<Account> people,int i,ArrayList<Account> list)
{
System.out.println("**************************************************");
System.out.println(" 欢迎使用中国工商银行自动柜员系统");
System.out.println("请输入您的密码:");
Account s=new Account();
File file = new File("accountinformation.txt");
ObjectInputStream oin = null;
try {
oin = new ObjectInputStream(new FileInputStream(file));
people = (ArrayList<Account>) oin.readObject();
s=people.get(i);
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
for(int j=0;j<3;j++)
{
Scanner in = new Scanner(System.in);
String password=in.next();
if(s.getaccountpassword().equals(password))
{
enter(s.getaccountID(),people,list);
}
else
System.out.println("密码录入错误");
}
System.out.println("该账号三次录入密码错误,该卡已被系统没收,请与工行及时联系处理");
}
public void enter(String a,ArrayList<Account> people,ArrayList<Account> list)
{
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"使用中国工商银行自助柜员系统");
System.out.println("1、存款;");
System.out.println("2、取款;");
System.out.println("3、转账汇款;");
System.out.println("4、修改密码;");
System.out.println("5、查询余额;");
System.out.println("请输入选择:");
Scanner in = new Scanner(System.in);
int operatetype=in.nextInt();
switch(operatetype) {
case 1:deposit(a,people,list);break;
case 2:withdrawal(a,people,list);break;
case 3:transfer(a,people,list);break;
case 4:alter(a,people,list);break;
case 5:seclect(a,people,list);break;
}
}
public void deposit(String a,ArrayList<Account> people,ArrayList<Account> list)
{
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("请输入存款金额:");
Scanner in = new Scanner(System.in);
String money=in.next();
int flag=0;
if(money=="q")
{
enterID(people,list);
}
int num=Integer.valueOf(money);
File file = new File("accountinformation.txt");
ObjectInputStream oin = null;
try {
oin = new ObjectInputStream(new FileInputStream(file));
people = (ArrayList<Account>) oin.readObject();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Account ac=new Account();
for(int i=0;i<people.size();i++)
{
ac=people.get(i);
if(ac.getaccountID().equals(a))
{
flag=i;
break;
}
}
ac.setaccountbalance(ac.getaccountbalance()+num);
people.set(flag,ac);
System.out.println("当前账户存款操作成功。");
System.out.println("当前账户余额为:"+ac.getaccountbalance());
int operatetype=1;
ac.setoperatetype(operatetype);
ac.setamount(num);
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dateNowStr = sdf.format(date);
ac.setoperatedate(dateNowStr);
list.add(ac);
File file1 = new File("accountlist.txt");
// 对象输出流
ObjectOutputStream out = null;
ObjectOutputStream out1 = null;
try {
out = new ObjectOutputStream(new FileOutputStream(file));
out.writeObject(people);
out.flush();
out.close();
// 将数组对象写入文件
out1 = new ObjectOutputStream(new FileOutputStream(file1));
out1.writeObject(list);
out1.flush();
out1.close();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("1、返回输入账户界面");
System.out.println("2、返回操作界面");
int i=in.nextInt();
switch(i)
{
case 1:enterID(people,list);break;
case 2:enter(a,people,list);break;
}
}
public void withdrawal(String a,ArrayList<Account> people,ArrayList<Account> list)
{
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println(" 当前账户每日可以支取2万元。");
System.out.println(" 1、100元");
System.out.println(" 2、500元");
System.out.println(" 3、1000元");
System.out.println(" 4、1500元");
System.out.println(" 5、2000元");
System.out.println(" 6、5000元");
System.out.println(" 7、其他金额");
System.out.println(" 8、退卡");
System.out.println(" 9、返回");
Scanner in = new Scanner(System.in);
int x=in.nextInt();
int flag = 0;
int money = 0;
switch(x)
{
case 1:money=100;break;
case 2:money=500;break;
case 3:money=1000;break;
case 4:money=1500;break;
case 5:money=2000;break;
case 6:money=5000;break;
case 8:enterID(people,list);break;
case 9:enter(a,people,list);break;
}
if(x==7)
{
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("******************************************************");
System.out.println("请输入取款金额:");
money=in.nextInt();
}
File file = new File("accountinformation.txt");
ObjectInputStream oin = null;
try {
oin = new ObjectInputStream(new FileInputStream(file));
people = (ArrayList<Account>) oin.readObject();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Account ac=new Account();
for(int i=0;i<people.size();i++)
{
ac=people.get(i);
if(ac.getaccountID().equals(a))
{
flag=i;
break;
}
}
if(ac.getaccountbalance()<money)
{
System.out.println("账户余额不足");
}
else
{
ac.setaccountbalance(ac.getaccountbalance()-money);
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("当前账户取款操作"+money+"元成功。");
System.out.println("当前账户余额为:"+ac.getaccountbalance()+"元成功。");
}
int operatetype=2;
ac.setoperatetype(operatetype);
ac.setamount(money);
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dateNowStr = sdf.format(date);
ac.setoperatedate(dateNowStr);
list.add(ac);
people.set(flag, ac);
File file1 = new File("accountlist.txt");
ObjectOutputStream out = null;
ObjectOutputStream out1 = null;
try {
out = new ObjectOutputStream(new FileOutputStream(file));
out.writeObject(people);
out.flush();
out.close();
// 将数组对象写入文件
out1 = new ObjectOutputStream(new FileOutputStream(file1));
out1.writeObject(list);
out1.flush();
out1.close();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("1、返回输入账户界面");
System.out.println("2、返回操作界面");
int i=in.nextInt();
switch(i)
{
case 1:enterID(people,list);break;
case 2:enter(a,people,list);break;
}
}
public void transfer(String a,ArrayList<Account> people,ArrayList<Account> list)
{
int flag=0;
int money=0;
Account ab=new Account();
Scanner in = new Scanner(System.in);
File file = new File("accountinformation.txt");
ObjectInputStream oin = null;
try {
oin = new ObjectInputStream(new FileInputStream(file));
people = (ArrayList<Account>) oin.readObject();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Account ac=new Account();
for(int i=0;i<people.size();i++)
{
ac=people.get(i);
if(ac.getaccountID().equals(a))
{
flag=i;
break;
}
}
int num=0;
int leap=-1;
while(num==0)
{
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("******************************************************");
System.out.println("请输入转账账户:");
String b=in.next();
for(int i=0;i<people.size();i++)
{
int j=0;
ab=people.get(i);
if(ab.getaccountID().equals(b))
{
leap=i;
num=1;
break;
}
else
{
num=0;
}
}
if(num==0)
{
System.out.println("该账户不存在");
}
if(num==1)
{
int num2=0;
while(num2==0)
{
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("******************************************************");
System.out.println("请输入转账金额:");
money=in.nextInt();
if(ac.getaccountbalance()<money)
{
System.out.println("户余额不足");
System.out.println("您当前的余额为"+ac.getaccountbalance()+"元");
}
if(ac.getaccountbalance()>=money)
{
num2=1;
}
}
String name=ab.getaccountname();
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("******************************************************");
System.out.println("请确认是否向"+name+"转账"+money+"元");
System.out.println("确认请按Y,否请按N");
String x=in.next();
if(x.equals("X"))
{
enter(a,people,list);
}
if(x.equals("Y"))
{
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("******************************************************");
System.out.println("成功向"+name+"转账"+money+"元");
ac.setaccountbalance(ac.getaccountbalance()-money);
ab.setaccountbalance(ab.getaccountbalance()+money);
System.out.println("当前账户余额为:"+ac.getaccountbalance());
num=1;
}
}
}
people.set(flag, ac);
people.set(leap, ab);
int operatetype=3;
ac.setoperatetype(operatetype);
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dateNowStr = sdf.format(date);
ac.setoperatedate(dateNowStr);
ac.setamount(money);
list.add(ac);
File file1 = new File("accountlist.txt");
ObjectOutputStream out = null;
ObjectOutputStream out1 = null;
try {
out = new ObjectOutputStream(new FileOutputStream(file));
out.writeObject(people);
out.flush();
out.close();
// 将数组对象写入文件
out1 = new ObjectOutputStream(new FileOutputStream(file1));
out1.writeObject(list);
out1.flush();
out1.close();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("1、返回输入账户界面");
System.out.println("2、返回操作界面");
int i=in.nextInt();
switch(i)
{
case 1:enterID(people,list);break;
case 2:enter(a,people,list);break;
}
}
public void alter(String a,ArrayList<Account> people,ArrayList<Account> list)
{
int flag=0;
Scanner in = new Scanner(System.in);
File file = new File("accountinformation.txt");
ObjectInputStream oin = null;
try {
oin = new ObjectInputStream(new FileInputStream(file));
people = (ArrayList<Account>) oin.readObject();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Account ac=new Account();
for(int i=0;i<people.size();i++)
{
ac=people.get(i);
if(ac.getaccountID().equals(a))
{
flag=i;
break;
}
}
int num=0;
while(num==0)
{
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println(" 请输入当前密码:");
String pass=in.next();
if(ac.getaccountpassword().equals(pass))
{
num=1;
}
if(num==0)
System.out.println(" 当前密码录入错误");
if(num==1)
{
System.out.println(" 请输入修改密码:");
String n1=in.next();
System.out.println(" 请输入确认密码:");
String n2=in.next();
if(n1.equals(n2))
{
num=1;
ac.setaccountpassword(n1);
}
else
{
num=0;
System.out.println(" 修改密码与确认密码不一致");
}
}
}
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("当前账户密码修改成功");
people.set(flag, ac);
/*int operatetype=4;
ac.setoperatetype(operatetype);
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dateNowStr = sdf.format(date);
ac.setoperatedate(dateNowStr);
list.add(ac);*/
File file1 = new File("accountlist.txt");
ObjectOutputStream out = null;
ObjectOutputStream out1 = null;
try {
out = new ObjectOutputStream(new FileOutputStream(file));
out.writeObject(people);
out.flush();
out.close();
// 将数组对象写入文件
out1 = new ObjectOutputStream(new FileOutputStream(file1));
out1.writeObject(list);
out1.flush();
out1.close();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("1、返回输入账户界面");
System.out.println("2、返回操作界面");
int i=in.nextInt();
switch(i)
{
case 1:enterID(people,list);break;
case 2:enter(a,people,list);break;
}
}
public void seclect(String a,ArrayList<Account> people,ArrayList<Account> list)
{
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("******************************************************");
Scanner in = new Scanner(System.in);
File file = new File("accountinformation.txt");
ObjectInputStream oin = null;
try {
oin = new ObjectInputStream(new FileInputStream(file));
people = (ArrayList<Account>) oin.readObject();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Account ac=new Account();
for(int i=0;i<people.size();i++)
{
ac=people.get(i);
if(ac.getaccountID().equals(a))
{
break;
}
}
System.out.println("当前账户余额为:"+ac.getaccountbalance()+"元");
System.out.println("账户清单信息为:");
File file1 = new File("accountlist.txt");
ObjectInputStream oon = null;
try {
oon = new ObjectInputStream(new FileInputStream(file1));
list = (ArrayList<Account>) oon.readObject();
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Account ab=new Account();
for(int i=0;i<list.size();i++)
{
ab=list.get(i);
if(ab.getaccountID().equals(a))
{
String op = null;
if(ab.getoperatetype()==1)
op="存款";
if(ab.getoperatetype()==2)
op="取款";
if(ab.getoperatetype()==3)
op="转账汇款";
System.out.println(""+ab.getoperatedate()+" "+op+" "+ab.getamount());
}
}
System.out.println("******************************************************");
System.out.println(" 欢迎"+a+"用户使用中国工商银行自助柜员系统");
System.out.println("1、返回输入账户界面");
System.out.println("2、返回操作界面");
int i=in.nextInt();
switch(i)
{
case 1:enterID(people,list);break;
case 2:enter(a,people,list);break;
}
}
}
java测试的更多相关文章
- Java测试工具
1. 开源测试工具: http://www.open-open.com/43.htm 2. 10款常用的JAVA测试工具 :http://developer.51cto.com/art/200 ...
- 在Jmeter中使用自定义编写的Java测试代码
我们在做性能测试时,有时需要自己编写测试脚本,很多测试工具都支持自定义编写测试脚本,比如LoadRunner就有很多自定义脚本的协议,比如"C Vuser","Java ...
- 如何使用 Java 测试 IBM Systems Director 的 REST API
转自: http://www.ibm.com/developerworks/cn/aix/library/au-aix-systemsdirector/section2.html 如何使用 Java ...
- 第一次Java测试及感触
周四进行了java测试,感触很深,测试的题目是用Java实现一个ATM机的管理系统.最后3个小时后,我没有完成这次测试,但是我找到了自己的很多不足,明确了自己的问题究竟在哪里. 关于这次测试我不会的最 ...
- 第一次java测试有感
今天下午的Java测试体会深刻,真的可能我一暑假学的还没有今天一下午学的多.但通过今天一下午地与Java近距离接触 ,我感受到我与真正的Java距离还是特别远的.以后我的路还很长,我对Java仍然还是 ...
- Java测试工具使用(1)--Junit
在进行测试之前需要导入junit的两个包,分别是 junit:4.12;hamcrest-core:1.1 1.基本测试标签 @Test.@Before.@After 2.组测试 有时候多个测试文件, ...
- Java测试工具和框架
个人目前只接触过JUnit以及Powermock,后续会关注更多有关测试这方面的东西 8个超实用的Java测试工具和框架_开发/数据库_IT专家网 http://database.ctocio.com ...
- 自定义编写jmeter的Java测试代码
我们在做性能测试时,有时需要自己编写测试脚本,很多测试工具都支持自定义编写测试脚本,比如LoadRunner就有很多自定义脚本的协议,比如"C Vuser","JavaV ...
- 8个超实用的Java测试工具和框架
Java入门 如果你才刚开始接触Java世界,那么要做的第一件事情是,安装JDK——Java Development Kit(Java开发工具包),它自带有Java Runtime Environme ...
- 第一次Java测试及感触(2018.9.20)
在本周周四进行了java测试,有一点感触,测试的题目是用Java实现一个ATM机的管理系统.之前老师提前给我们样卷,结果考试的时候换了题型,瞬间脑子空白,一时不知道怎么下手,因为暑假虽然涉猎了java ...
随机推荐
- Mybatis-利用resultMap 输出复杂pojo
个:复杂的sql语句查询的数据集的字段和 pojo的字段不相同,需要用到resultMap做一个对应. ---------------- mybatis中使用resultMap完成高级输出结果映射. ...
- [转载]tmux常用快捷键
Hello World 窗口管理只是 tmux 功能的一小部分,另一个很有用的功能就是,连接到远程主机之后,一旦断开,那么当前账户登录的任务就被取消了,但是使用 tmux 可以在断开之后继续工作,下次 ...
- 使用grep排除空行和注释行
grep的排除选项为 -v排除空行的命令是:grep -v '^$' filename排除以#注释的命令是:grep -v '^#' filename 结合起来就是,既排除空行又排除注释行的命令gre ...
- v2v-VMware/VSphere中虚机离线迁移至openstack平台
先决条件 exsi到openstack的迁移,分为两种,一种是静态迁移,另一种是在线迁移. 静态迁移(offline migration)也叫做常规迁移,离线迁移.在迁移之前将虚拟机暂停,同时拷贝虚拟 ...
- [PDFBox]后台操作pdf的工具类
PDFBox是Apache下的一个操作pdf的类库.其也提供了一个命令行的工具,也提供了java调用的第三方类库. 下载地址:https://pdfbox.apache.org/ 下面的实验基于JDK ...
- Invalid character found in the request target.
背景:springboot项目内置tomcat9.0 调用的接口中有{}就会报错 解决办法: 新的tomcat新版本增加了一个新特性,就是严格按照 RFC 3986规范进行访问解析,而 RFC 398 ...
- oracle查看未提交事务
SELECT s.sid, s.serial#, s.event, a.sql_text, a.sql_fulltext, s.username, s.status, s.machine, s.ter ...
- [转]Python中的eval()、exec()及其相关函数
Python中的eval().exec()及其相关函数 刚好前些天有人提到eval()与exec()这两个函数,所以就翻了下Python的文档.这里就来简单说一下这两个函数以及与它们相关的几个函数 ...
- 转-CSRF&OWASP CSRFGuard
一. 什么是CSRF?CSRF(Cross-Site Request Forgery)直译的话就是跨站点请求伪造也就是说在用户会话下对某个需要验证的网络应用发送GET/POST请求——而这些请求是未经 ...
- $Django 路由层(有,无名分组、反向解析、总路由分发、名称空间、伪静态)
1 简单配置 -第一个参数是正则表达式(如果要精准匹配:'^publish/$') -第二个参数是视图函数(不要加括号) -url(r'^admin/', admin.site.urls), 注: ...