j2ee| Notes | server | client
Learn some Java EE every week, make some notes.
Goal: Be proficient in using WebSphere to do Java EE development work.
Come on! Come on!! Come on!!!
Figure 3 Java EE scene
The following should be noted in figure three:
1, Tier integration is the center of the
Java obtains the real ip address of the client, and java obtains the ip address
In JSP, the method for obtaining the Client IP address is request. getRemoteAddr (), which is valid in most cases. However, the real IP address of the client cannot be obtained through reverse pr
Java Operations Redis Simple example
Beginner Redis, in the Java language and environment to complete the Redis learning. First, the official website downloads the source code, compiles, installs, modifies the configuration file redis.conf three items: 1.Comment out bind 1
A small example, used for Java and C # TCP communication, Java as a client,c# as a server,server thread pool.
The main function is that the client can send data to the server, and then the server sends data to the client, disconnected;
Corresponds to the
Using Java to operate Redis requires Jedis-2.1.0.jar,:http://files.cnblogs.com/liuling/jedis-2.1.0.jar.zipIf you need to use a Redis connection pool, you need to Commons-pool-1.5.4.jar,:http://files.cnblogs.com/liuling/commons-pool-1.5.4.jar.zip 1 package com.test; 2 3 Import Java.util.HashMap; 4 Import Java.util.Iterator; 5 Import Java.util.List; 6 Import J
Reprint: http://www.cnblogs.com/liuling/p/2014-4-19-04.htmlUsing Java to operate Redis requires Jedis-2.1.0.jar,:http://files.cnblogs.com/liuling/jedis-2.1.0.jar.zipIf you need to use a Redis connection pool, you need to Commons-pool-1.5.4.jar,:http://files.cnblogs.com/liuling/commons-pool-1.5.4.jar.zip 1 package com.test; 2 3 Import Java.util.HashMap; 4 Impor
Using Java to operate Redis requires Jedis-2.1.0.jar,:http://files.cnblogs.com/liuling/jedis-2.1.0.jar.zipIf you need to use a Redis connection pool, you need to Commons-pool-1.5.4.jar,:http://files.cnblogs.com/liuling/commons-pool-1.5.4.jar.zip 1 package com.test; 2 3 Import Java.util.HashMap; 4 Import Java.util.Iterator; 5 Import Java.util.List; 6 Import J
GitHub Source:
Github.com/z521598/redis-lockImplementation principle:
1.setnx
Redis's setnx Directive (document reference), setnx means set if not eXists, command format: setnx $key $value
If this key does not exist, it is set to value, the return value is 1, and if this key exists, it is not set and the return value is 0. Such as:
127.0. 0.1:6379[1]>1127.0. 0.1:6379[1]>0
Redis is single-threaded and thread
Java implements file upload on the server and client, and java implements File Upload
The examples in this article share the specific code of the Java File Upload server and client for your reference. The specific content is as follows:
File Upload Server:
/*** Use the TCP p
(); Socket.shutdownoutput ();//This is not less!!!!!!!!!!!!!! Receive server-side backhaul information InputStream inputstream=socket.getinputstream (); BufferedReader bufferedreader=new BufferedReader (New InputStreamReader (InputStream)); String Info;while ((Info=bufferedreader.readline ())!=null) {System.out.println ("I am the client, server side returns::" +info);} Close resource Bufferedreader.close (); Inputstream.close ();p rintwriter.close ()
Code debugging methods for Redis in JAVA Web projectsRedis is used in the development of the project, it is necessary to debug the correctness of the output data,Method One: Modify the code and temporarily do not fetch data from RedisMethod Two: Clear all keys in the Redis databaseLog in to the REDIS server and switch
Absrtact: The spring Framework is the core container, Spring MVC is the Model View controller, MyBatis is the data access layer, Apache Shiro is the permission authorization layer, Ehcahe caches the common data, Activit is the workflow engine and so on.Framework introduction-mainly located in the Internet Enterprise architecture, has built-in enterprise information system basic functions and efficient code generation tools, including: System permissions components, data rights components, data d
In the development of the project to use the Redis, the need to debug the correctness of the output data,
Method One: Modifies the code, temporarily does not take the data from the Redis
Method Two: Clear all key in Redis database
Log on to the REDIS server, switch directories to
Java uses the redis database, javaredis Database
Use maven to manage jar and add dependency:
Use the redis database configuration (set the attribute value as needed) to store data
JedisPool jedisPool = null;
JedisPoolConfig poolConfig = new JedisPoolConfig ();
PoolConfig. setMaxIdle (10 );
PoolConfig. setMaxTotal (100 );
PoolConfig. setMaxWaitMillis (10000 )
name + parameter name as key, the data queried as value stored to the cache. if the increment, delete, change the operation, then use the Cachedelete method to intercept, the operation is as follows:according to the system name + class names as key, take out the corresponding value value ( system name + class name + method name + parameter name ), and then remove the system name + class name + method name + parameter name as key, and then delete the corresponding value value. How do I configure
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.