Annotation
Annotaions (also known as metadata) provide a formalized way to add information to yourcode so that you can easily use that data at some later point.Defining annotationshere is the definition of the annotation above. You can see that annotation definitions look a lot like interface definitions.
In fact, they compile to class files like any otherJa
labeled is inherited. If a annotation type that uses the @inherited modifier is used for a class, the annotation will be used for subclasses of that class.Note: @Inherited the annotation type is inherited by subclasses of the class being labeled. The annotation class does not inherit from the interface it implements,
Examples of Spring combination annotation and meta annotation in JSP, jspspring
Spring combination annotation and Metadata Annotation instances in JSP
Abstract: Annotation is also called metadata. A code-level description. It is at the same level as classes, interfaces, and
Android IOC annotation binding control and event case code simple annotation explanation, androidioc
I think android has used some frameworks. However, some annotations are used in the frameworks to help us and save a lot of code development workload. It also makes the code more concise.
However, annotations are implemented through java reflection and may sacrifice some performance.
The following is a simpl
Annotation, java Annotation
Old yuan annotation:
@ Target is used in our custom annotation to standardize our custom annotation. Interface enumeration class method property Annotation
@ Retention the meta
The topic is very big, the feeling ability is limited, it is difficult to say these things at once, can only slightly make a collation, for reference. Annotation, annotations. A superficial understanding is a method that can help us simplify code or resource configuration files and improve productivity. More and more frameworks provide annotation expansion to help us accomplish our tasks better.
The study o
you to declare the default value for any annotation member: A annotation can use Name=value as a value for a annotation member that does not have a default value defined, and of course it can be used name= The value pair overrides the other member's default value. This is somewhat similar to the inheritance attribute
Annotation-based bean configuration and annotation bean Configuration
Annotation-based bean configuration mainly involves applicationContext. xml configuration, DAO layer class annotation, and Service layer class annotation.
1. Configure the following information in the ap
Simulate and implement annotation Assembly in Spring, spring Annotation
Original article, address for http://www.cnblogs.com/fengzheng/p/5037359.html
In Spring, bean configuration in the XML file is the core configuration file for implementing Spring IOC. in earlier versions of Spring, dependencies between objects can only be configured based on XML configuration files. Annotations have appeared after Sprin
Scriptlet and annotation in JSP, and JSPscriptlet Annotation
Scriptlet and comment in JSP.
Scriptlet:
In JSP, most of them are composed of Scriptlet. A script applet is embedded in html code and directly contains java code. There are three types of code:
The first
int i = 10 ; int j = 20 ; out.println(i * j) ; out.println(""+ (++ I) + "")
Type 2
"+ (++ I) +" "); %>
Note t
Directly speak with the Code. For more information, see annotations ..
The first is the custom annotation using @ inherited ---- inheritedtest. Java
Package COM. jadyer. annotation. inherited;
Then we use our custom @ inheritedtest annotation to mark the parent class ---- parent. Java
Package COM. jadyer. annotation.
Detailed description of the second-level cache of the Hibernate annotation method, detailed description of the hibernate Annotation
Detailed description of the second-level cache in the Hibernate annotation Method
By default, hibernate supports level-1 caching, that is, session-level caching. By default, level-2 caching is not supported, that is, sessionFactory-l
@ Entity
Annotate a POJO class into an object bean (persistent POJO class)
@ Table
Specify a specific table for the object bean ing. If the annotation is not declared, the system uses the default value (that is, the short class name of the object bean without the package name)
@ Id
Define an attribute in the Entity bean as an identifier)
@ GeneratedValue
This annotation defines the generation policy for thi
, the Retention of annotation is RetentionPolicy. RUNTIME, the reflection API enhances this inheritance. If we use java. lang. when reflect queries an annotation of the @ Inherited annotation type, the reflection code check starts: Check the class and its parent class until the specified
The inheritance methods in C + + are:Public, private, protected three (they directly affect the members of the derived class, and the rules that their objects access to the base class members).(1) Public: Inheritance keeps the properties of the members in the base class intact, and the private members in the base class are hidden.members of derived classesYou can access only public/protected members in the
Annotations are no more useful than annotations if there is no method or work for reading annotations. In the process of using annotations, it is important to create a use of the annotation processor. The Java SE5 expands the reflection mechanism API to help programmers quickly construct custom annotation processors.
Annotation Processor Class Library (java.lang
to declare the default value for any annotation member: A annotation can use Name=value as a value for a annotation member that does not have a default value defined, and of course it can be used name= The value pair overrides the other member's default value. This is somewhat similar to the inheritance attribute of t
Annotation management method 2 of Spring framework context uses annotation injection object attributes, springcontext
First, it is the xml configuration file.
NextIt is assumed that the dao class
package com.swift;import org.springframework.stereotype.Component;@Component(value="dao")public class Dao { public String fun() { return "This is Dao's fun()........"; }}
It is very convenient
called to handle the current request.6,7,8 all inherit Abstracthandlerexceptionresolver, this class implements Handlerexceptionresolver, the interface definition: an object implemented by an interface can resolve processor mappings, exceptions thrown during execution, There is also the wrong view.So the Its implementation class is Org.springframework.context.annotation.ComponentScanBeanDefinitionParser.Put the mouse on the Context:component-scan to know what the role of the package is used to s
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.