In this section:
Spring support overview
All Spring plugins are bundled with the IDE and are enabled by default.
The Spring facet is often used in combination with Hibernate.
The Spring support in IntelliJ IDEA includes:
- Complete coding assistance, including smart completion in configuration files.
- Spring-aware refactorings.
- Highlighting, inspections and quick-fixes.
- Visual Spring diagrams for viewing dependencies.
- A dedicated Spring file set editor.
- Built-in File Templates for Spring context files.
- Live Templates for beans and patterns.
Spring aspect-oriented programming (AOP) support, with full coding assistance:
- Smart code completion and highlighting.
- AspectJ-aware code completion with syntax and error highlighting.
- Numerous AspectJ-aware quick-fixes.
- Enhanced navigation with active gutter icons.
- Spring AOP inspections.
- The p-namespace support for properties definition.
- Spring annotations support.
- Support for filters to customize scanning.
- Parsing custom Spring beans
- Navigation for beans defined with Spring custom namespaces.
- Spring 2.5:
bean()pointcut designator support.
- Find by symbol.
- Quick Javadoc (Ctrl+Q) on bean references.
- Coding assistance for
@Configuration-annotated Java classes and related annotations (
- Quick navigation from
@ContextConfiguration-annotated JUnit test cases to corresponding Spring configuration files by means of active gutter icons (see the screencast).
- Support for certain Spring 3.1 features including:
- The c-namespace support with code completion, error highlighting, quick fixes and code generation.
Bean definition profiles support.
In addition to code completion and error highlighting, the following features are available:
- For xml files containing profile definitions (
<beans profile=...), an additional status bar is provided at the top of the editor. Shown in this bar are the names of the profiles which are currently active. This bar also accommodates the controls for activating and deactivating the profiles.
- Definitions of active and inactive profiles are shown in the editor in different colors.
- Quick fixes (for found problems) are suggested only for the definitions that are currently active.
- You can search for profiles in the xml configuration files,
@Profileannotations and Java code and, if necessary, perform the Rename refactoring for them.
- For xml files containing profile definitions (
Spring Security support:
Almost all tags are supported; new Spring Security 3.1 namespace elements
<session-management>, etc.) are supported in full. This includes code completion, navigation and the rename refactoring.
- Language injections for AOP and SQL are available.
- Spring Security OAuth 1.0 and 2.0 namespaces are supported.
See also, Spring Security Support in IntelliJ IDEA 12.
- Almost all tags are supported; new Spring Security 3.1 namespace elements (e.g.
Spring Integration support (up to version 2.2):
All existing namespaces are supported
Redis). Coding assistance includes code auto-completion, highlighting, quick-fixes, inspections, and navigation.
rabbitnamespace is supported out-of-the-box, simplifying the integration with AMQP.
Language injections are available for all attributes containing Spring EL expressions
(including references to header names),
<groovy:script>and everything containing
- The rename refactoring is supported throughout the framework.
- The Spring dependencies diagram lets you view the element dependencies and navigate to the referenced beans.
See also, Spring Integration in IntelliJ IDEA 12.
- All existing namespaces are supported (including
- Spring Batch support with the ability to download and configure the Spring Batch libraries. Coding assistance features include code completion and highlighting in XML files, and the rename refactoring. Predefined Spring EL variables and references to step-scoped beans are resolved automatically. For more information, see Support for Spring Batch in IntelliJ IDEA 12.
Spring Web Flow support:
Structure view is available for
Spring EL is fully supported in
flow.xml. This includes code completion, navigation and refactoring.
All built-in and custom attributes are available on JSP pages.
- The Navigate | Symbol option (Ctrl+Shift+Alt+N) lets you quickly navigate to any of the states. In the editor, gutter icons are provided for navigating to parent or child elements. To access a parent or child flow or subflow, you can use Navigate | Related Symbol (Ctrl+Alt+Home).
- All Spring Web MVC views are accessible.
See also, Spring Web Flow Support in IntelliJ IDEA 12.
- Structure view is available for
- Spring Data JPA support. See Spring Data JPA in IntelliJ IDEA 11.
- Support of the spring-websocket module.
- Support for Spring Boot projects and integration of Spring Initializr into the New Project wizard. For more details, see Spring Boot.
When using Spring and Hibernate in a project simultaneously, the following integration features are available:
- Dedicated templates to support Hibernate in Spring configuration files.
- Hibernate-aware code completion in Spring configuration files.
- The support of AbstractAnnotationConfigDispatcherServletInitializer in Spring MVC. It might be useful for Spring MVC configurations.
Developing an application using Spring
Before you start developing a Spring application, enable the Spring support in IntelliJ IDEA.
The tasks specific to Spring application development are discussed in the following topics:
- Managing Spring Configuration Files
- Managing File Sets
- Using Spring Bean Templates
- Using Spring Bean Patterns
For general instructions, refer to How-to.
Language and Framework-Specific Guidelines:
- Support for Spring Batch in IntelliJ IDEA 12
- Spring Integration in IntelliJ IDEA 12
- Spring Web Flow Support in IntelliJ IDEA 12
- Spring Security Support in IntelliJ IDEA 12
- AnnotationConfigApplicationContext support in IntelliJ IDEA 11.1
- New in IntelliJ IDEA 11: Spring 3.1 @Configuration-based contexts support
- Spring Data JPA in IntelliJ IDEA 11
- Spring 3.1 c-namespace in IntelliJ IDEA 10.5
- New in IntelliJ IDEA 10.5: Spring Integration support
- New in IntelliJ IDEA 10.5: Spring 3.1 bean definition profiles