1 2 3 Previous Next 35 Replies Latest reply on Feb 18, 2016 8:13 PM by BonanzaOne

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

    BonanzaOne

      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>
      
        1 2 3 Previous Next