Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSF 2 suggestions / auto-complete for Facelets pages not working for annotated @ManagedBean

BonanzaOneJul 29 2015 — edited Feb 18 2016

Hi,


I'm using Eclipse Mars 4.5 with latest OEPE plugin version 12.1.3.7.

Why annotated managed beans @ManagedBean (javax.faces.bean.ManagedBean) are not suggested by the plug-in when coding a facelet page?

I spent hours and the only way I managed to get the plugin suggestions was declaring it in the faces-config.xml.

Steps to simulate the problem:

  1. In Eclipse, create a new Dynamic Web Project - Servlet 2.5 (does not have to be Maven to simulated)
  2. Apply the JSF 2.0 to the project, and in the "further configuration" download the Oracle library 2.0.3 for JSF 2.0.
  3. Create a Java class and annotate it with @ManagedBean.
  4. Create a facelet (xhtml for example) and try to reference the managed bean.
  5. The editor will not suggest the created bean.

I tried a fresh Eclipse installation with no plugins and it worked. Once I installed OEPE (WebLogic Server Tools) the suggestions stopped working. The managed bean is listed in the project structure by AppXRay, but no suggestions.

Disabling AppXRay did not make any efffect.

Let's say I have the following managed bean:

import javax.faces.bean.ManagedBean;

import javax.faces.bean.SessionScoped;

@ManagedBean

@SessionScoped

public class CustomerBean {

  private String name;

  public String getName() {

       return name;

  }

  public void setName(String name) {

       this.name = name;

  }

}

The editor of the facelet will not suggest any beans, unless I declare in config file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"

  xmlns:ui="http://java.sun.com/jsf/facelets"

  xmlns:h="http://java.sun.com/jsf/html"

  xmlns:f="http://java.sun.com/jsf/core">

<body>

  <!-- Here in the EL the bean should be listed, but the editor makes no suggestions -->

  <h:outputText value="#{}" />

</body>

</html>

This post has been answered by Ram V-Oracle on Feb 16 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2016
Added on Jul 29 2015
35 comments
11,058 views