In this article, we discuss 13 different static exposure techniques. For each type of exposure, we explain the impact of not dealing with these security issues. We also recommend some rules for you to develop robust and secure Java applications that
From http://www.blogjava.net/zhujiang001/archive/2005/10/27/16980.html
1. Use the load () method of java. util. Properties class
Example:
InputStream in = lnew BufferedInputStream (new FileInputStream (name ));
Properties p = new Properties ();
P.
Note hashcode only when hashtable, hashmap, hashset, and linkedhashmap are used. hashcode is useless in other places. (This is not necessarily true)
Whether two objects are equal requires that hashcode () be equal. Is the following statement
Spring AOP Advices
Advices implements the real logic of Aspect. Specifically, in java, It is a class or more fine-grained design into a method (one class centrally manages multiple Advices ). Spring provides several different Advices, such as Before
Memory architecture of Java Virtual Machine
After learning about the JVM basics, let's take a look at the memory architecture of the Java Virtual Machine. This is a prerequisite for understanding the JVM garbage collection algorithm, after
Java to obtain the project access path, java to obtain the project path
The relative paths called in jsp and class files are different.
In jsp, the root directory is WebRoot in the class file, the root directory is WebRoot/WEB-INF/classes of course
The equals method only determines whether two variables point to the same memory area to determine whether they are equal,
Students [0] = new student ("Huaihua College", "Small Group", 22); students [1] = new student ("Huaihua College", "Small
Based on the json-lib.jar package JSON program, this article mainly introduces a simple example!1. First, JSON-lib must support at least the following JAR packagesJakarta commons-lang 2.4Jakarta commons-beanutils 1.7.0Jakarta commons-collections
Inject dependency objectsBasic Type object injection: // constructor Injection // property setter method InjectionInject other beans:Method 1:Method 2 (internal bean is used, but this bean cannot be used by other beans)
Xmlns: xsi = "http://www.w3.
Backup a useful tool class. typeutilIts typetostring (string scope, object OBJ) method adopts the reflect mechanism of Java to print the content of any object.This is very useful for debugging programs.Usage:If you have an object (such as
Spring has two types of beans: common bean and factory bean, namely factorybean. The factory bean is different from the common bean. The returned object is not an instance of the specified class, and the returned object is the object returned by the
Concept
Separates a complex build from its representation so that different representations can be created during the same build process.
Class Diagram
Code
public abstract class Computer { private String type; private String cpu; private
Getresourceasstream: searches for resources with a given name. Return inputstreamgetresource: Find the resource path with the given name. Return URL
Simple Example: (Note: any class has a getclass () method)
Public class test {Public void
Below I present you and different ways to get the current Class:
Using Thread
Using GetClass ()
The simplest-to-get the name of the class where your code is being executed in are using the getClass() method present in Ev Ery Java
In the Java API, there are two ways to read resources using CLASSPATH.1. Class GetResource ()2. ClassLoader's GetResource ()But there are some differences between the two, run the following program: PackageZero.xml.config; Public classMain { Public
The type of the parent class or interface is obtained by Getgenericsuperclass () or getgenericinterfaces () on class. Then through Parameterizedtype.getactualtypearguments ()You can get a generic type defined on a class or interface, as in the
Visitor pattern: Represents an element action that acts on an object structure. It allows you to define new operations that act on these elements without changing the class of each element.First, define a visitor abstract class, declaring a visit
This article takes mobile phone traffic statistics as an example:The following fields are included in the logNow you need to count the mobile phone uplink packets, downlink packets, upstream total traffic, downlink total traffic.Analysis: You can
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.