Add the Java.util.concurrent (J.U.C) package to JDK1.5, which is built on top of CAs. A common implementation of the CAS non-blocking algorithm, which has a better performance compared to the synchronized blocking algorithm. optimistic
Recently, our marketing department made a request to create a WAP website, one of the content requirements dynamic generation, after several days of efforts, I have basically completed the task, here I recorded the completion of the entire task
Web.xml files are required for configuring any Java Web application.
(1) Configure the Actionservlet of struts
action org.apache.struts.action.ActionServlet
Also configure the element to specify which URLs Actionservlet can handle
action
This problem came up today when we ran the abstracttransactionaljunit4springcontexttests test.
Could not find usertransaction in JNDI [java:comp/usertransaction];
My test code
@ContextConfiguration (locations =
downLoadFile
*. loadfile
pageservlet
/pageservlet.page
The configuration rules are as follows:
In the WEB application deployment descriptor, the rules for mapping syntax are as follows:A string that starts with the "/"
Java IO
In order to reduce the amount of data transmitted in Java, a special compression stream is provided to compress a file or folder into a Zip,gzip,jar file format. Compression Stream Implementation
Three compressed formats supported by Java:
Key factors that affect Java performance
1 hardware configuration, such as CPU, memory, server architecture, etc. 2) operating system 3) database system and database server 4 JVM 5 Application Server 6 The impact of network Environment 7) system
State transitions between threads:
1. NEW: A new Thread object was created.
2. Operational (runnable): When a thread object is created, other threads (such as the main thread) invoke the object's start () method. The thread in the state is in
Recorded in the development of the month calendar display, customer requirements need to cancel the meeting in the calendar to exclude, the following two kinds of exclusion method of comparison, the second is logically wrong, there will be
I think of the deadlock today, I tried to write a.
Package com.ljl.thread;
public class Deallock implements Runnable {private int flag = 1;
This object must be static, synchronization must be shared by multiple threads static Object Resource1 =
How to: Read files directly using the HDFs API:
Solution:
The first method:
Source code: FileSystem fs = Filesystem.get (Uri.create (hdfsfilepath), config);
Instead: FileSystem fs = Filesystem.newinstance (Uri.create (hdfsfilepath),
Jmsreplyto
When producer sends a message, specifies a destination by specifying the Jmsreplyto attribute in its messages header, and when the consumer receives it, you can pass the getxxx () method to obtain this destination, and then to choose
Keytool can be used to generate JSK types of keystore, which can hold many key (private keys and corresponding certificates).
Import java.io.*;
Import java.security.*;
Import java.security.cert.*;
Import java.util.*;
Import java.math.*;
Import
Requirements:
Recently done a Java project, after the completion of the package installed, found that you can point to more than one instance, because the desktop display tray, so the point will appear a tray, and the system also has several JAVAW
Today, when debugging the app, the httpurlconnection to get the server data with the java.io.FileNotFoundException exception, the reason is not clear, but has found a solution.
Because we have two types of server data, one is XML (request with
Use of data flow (stream)
1) Stream's acquisition
① through the collection collection get
1
list list = new Arraylist (arrays.aslist (1,2,3,4,5));2
stream stream = List.stream ();
② is obtained by array
1
String[] Array = {"Are", "You",
Recently in doing Apple push, found a better open source project, the Chinese wrote
Download the address: Https://github.com/RamosLi/dbay-apns-for-java
The calling code is as follows:
Import Java.io.InputStream;
Import java.util.List;
Import
Workaround a problem with a copy or file save in a text document, open the file using UE, and save it as Utf-8 without a BOM format.
---an invisible character can cause such an exception. ---------The Java.lang.NumberFormatException:For input string
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service