- 浏览: 818253 次
- 性别:
- 来自: 北京
最新评论
-
greatwqs:
在前置请求页面返回token, 在提交接口中验证token, ...
Spring MVC 用拦截器+token防止重复提交 -
zhukewen_java:
这种方法的缺陷在于如果请求了两个save=true的方法,后面 ...
Spring MVC 用拦截器+token防止重复提交 -
byrgl5:
请问如果重复提交了三次呢?能避免吗?
Spring MVC 用拦截器+token防止重复提交 -
381895649:
是不是有病?
服务器被如下ip攻击,如何根据ip超找攻击来源 -
greatwqs:
最棒的10款MySQL管理工具
文章列表
package myThread;
import java.applet.Applet;
import java.awt.Graphics;
import java.text.SimpleDateFormat;
import java.util.Date;
public class CalendarTest extends Applet implements Runnable
{
Thread clock;
public void init()
{
if(clock==null)
{
clock=new Thread(this," ...
package mythread.tickets;
public class Tickets implements Runnable
{
static int tickets = 100;
Object o = new Object();
boolean isSell = false;
public void run()
{
// TODO Auto-generated method stub
if(!isSell)
{
while(true)
{
synchronized(this.getClass())
...
package moreChat;
import java.io.*;
import java.net.Socket;
import java.util.concurrent.*;
public class ChatClient
{
private static final int PORT = 8888;
private static ExecutorService exec = Executors.newCachedThreadPool();
public ChatClient()
{
try
{
Socket socket = new S ...
package udp;
import java.net.*;
public class TestUDPClient
{
public static void main(String args[]) throws Exception
{
//定义码头ds
DatagramSocket ds = new DatagramSocket();
//13行到23行完成的功能是: 定义可以发送数据的集装箱dp
String n = "123"; ...
/**
* @author 郑云飞
* 日期:2010年08月18日1:26
* 内容:基于TCP协议的文件传输
* 服务器端程序
*/
package socketFile;
import java.io.*;
import java.net.*;
public class Server extends Thread
{
File fi;
DataOutputStream ps ;
String filePath;
BufferedR ...
package pc;
//PipedStreamTest.java //启动类
import java.io.*;
public class PipedStreamTest
{
public static void main(String[] args) throws Exception
{
Sender t1 = new Sender(); //创建发送者对象;
Receiver t2 = new Receiver(); //创建接收者对象;
Piped ...
package test;
import java.io.*;
import java.net.*;
import java.util.Scanner;
public class Client
{
private Socket socket = null;
private class ReceiveThread extends Thread
{
@Override
public void run()
{
while (true)
{
try
{
DataInputStream dis = new DataIn ...
package udp;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
public class url
{
public static void main(String[] args) throws Exception
{
URL url1=new URL("file:/D:/1.txt");
...
package a1;
import java.util.Arrays;
public class ComparatorTest
{
/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub
Book b1=new Book(8,"java");
Book b2=new Book(3,"C语言");
Friut f1=new Friut(6,&quo ...
部分排序
import java.util.Arrays;
class SStudent
{
private int num;
String name;
public int getNum()
{
return num;
}
public String toString()
{
// TODO Auto-generated method stub
return "学号:"+num+"姓名:"+name;
}
public SStudent(int num, String name)
...
package Cloneable;
class Student implements Cloneable
{
String name;
int age;
Father f;
int[] a = {1,2,3};
Book[] books;
Student(String name,int age,Father f,Book[] books)
{
this.name = name;
this.age = age;
this.f = f;
this.books = books;
}
public String toString()
...
//package Comparator;
import java.util.*;
import java.io.*;
class Student implements Comparator
{
int age;
String name;
Student()
{
}
Student(int age,String name)
{
this.age=age;
this.name=name;
}
public int compare(Object o1,Object o2)//比较对象?vs? this vs o
{
return 0; ...
/**Argtest.java
*关于成员方法的参数,参数传递是“传值”,如果参数是引用,传的就是引用的值,即数组或对象的地址
*/
class People
{
String str;
private int age;
public int getAge()
{
return age;
}
public void setAge(int age)
{
this.age=age;
}
}
public class Argtest
{
int i = 20;
String str="good";
c ...
public class BytesTest
{
public static void main(String[] args)
{
byte[] b="java程序设计".getBytes();
//输入一个字符串,将它转换成字节数组
int n=6;//设置你要截取的字节数
if(n%2==0)
{
String str=new String(b,0,n);//重新创建一个字符串,b是字符创内容,0是截取前指针指向的位置,n是截取字节个数
System.out.println(s ...
package hashSet;
//set 类似与数据结构中的散列表
import java.util.Comparator;
import java.util.TreeSet;
//奇数在前,偶数在后,奇数升序排列,偶数降序排列
public class MyDemo
{
public static void main(String [] a)
{
TreeSet set=new TreeSet(
new Comparator()
{
int r=0;
public int compare(Object a, Ob ...