Eclipse中Spring Beans与JSF/EL自动补全问题及配置咨询
Hey there, let's break down your two technical questions with practical, actionable solutions:
1. How to Enable EL Autocompletion for Spring Beans in Eclipse?
The most reliable way to get EL autocompletion for Spring Beans in Eclipse is using Spring Tools 4 (ST4)—it’s purpose-built to enhance Spring-related development, including robust EL content assist. Here’s how to set it up:
- Install Spring Tools 4: Open Eclipse’s Marketplace (go to
Help > Eclipse Marketplace), search for "Spring Tools 4", and install the full plugin suite. It integrates smoothly with most Eclipse versions. - Ensure Spring Project Recognition: ST4 automatically detects Spring projects, but double-check your project has either:
- Annotated configuration classes (like
@Configuration,@ComponentScan) - Traditional XML configuration files (e.g.,
applicationContext.xml)
- Annotated configuration classes (like
- Enable EL Content Assist:
- Navigate to
Window > Preferences > Web > JSP Files > Content Assist > Advanced - Make sure the Spring EL Proposals option is checked
- For Thymeleaf files: ST4 includes built-in Thymeleaf support—just set the Thymeleaf editor as the default for
.html/.xhtmlfiles, and content assist will work for${...}expressions.
- Navigate to
- Key Note: Your Spring Beans must be registered in the Spring container (via
@Component,@Service,@Controllerannotations, or XML config) for ST4 to recognize them and offer property autocompletion.
2. Can JBoss Tools' JSF/EL Autocompletion Support Be Extended Beyond @ManagedBean and @Named Beans?
By default, JBoss Tools’ JSF/EL content assist is tied to JSF’s @ManagedBean and CDI’s @Named specifications, but you do have options to expand its scope:
Option 1: Custom Eclipse Plugin Extension (Advanced)
You can extend JBoss Tools’ existing EL content assist processor by implementing Eclipse’s ContentAssistProcessor interface. This lets you add logic to recognize other bean annotations (like Spring’s @Controller or custom annotations). Note this requires writing Eclipse plugin code, so it’s better suited for advanced users.
Option 2: Combine Spring Tools 4 with JBoss Tools
If your project uses both Spring and JSF, install both ST4 and JBoss Tools. ST4 will handle EL autocompletion for Spring Beans, while JBoss Tools covers JSF-specific components and CDI beans. Just ensure plugin versions are compatible—since you’re using Eclipse Oxygen, stick to the Oxygen-stable versions of both tools.
Confirmed JBoss Tools Installation Configuration
To install JBoss Tools’ JSF + CDI components for Eclipse Oxygen, use this update site:
http://download.jboss.org/jbosstools/oxygen/stable/updates/
Go to Help > Install New Software, add this site, then select the "JSF" and "CDI" component groups to install.
Relevant Reference Materials
- Facelets中Eclipse的EL建议/自动补全/代码辅助
- Eclipse中Facelets(JSF)与XHTML的自动补全(内容辅助)
- Eclipse Helios中JSF2 + CDI(Weld) Bean的内容辅助
内容的提问来源于stack exchange,提问作者Thies

