brunob
brunob

Reputation: 39

intellij - No code-completion for JSF2 @Named annotated bean

IntelliJ doesn't seem to recognize my JSF2 managed beans when I annotate them with @Named, the CDI (JSR299) annotation used when deploying your web application on a Glassfish server.

@Named("userBean")
@SessionScoped
public class UserBean implements Serializable {
    private String name;
    private String password;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}

I don't get any auto-completion when using the bean in an EL expression (e.g. #{userBean.name}). And when I open the JSF-tab in IntelliJ, there are no Managed Beans listed. When I use the @ManagedBean annotation, I do get auto-completion + my beans are listed in the JSF tab. Do I have to configure something or how do I get this working?

Screenshot: https://i.sstatic.net/0VDhz.png

Upvotes: 2

Views: 1738

Answers (1)

rdcrng
rdcrng

Reputation: 3443

Have you tried Right-Click Project > Add Framework Support > CDI? Also look into IntelliJ CDI Docs and IntelliJ JSF Docs.

Upvotes: 6

Related Questions