How to mix annotations with faces-config.xml

前端 未结 1 1759
青春惊慌失措
青春惊慌失措 2021-02-06 05:35

Using JBoss 6.0.0.Final, Richfaces 3.3.3.Final, MyFaces 2.0.6, facelets 1.1.15.B1 (a limitation of RF 3).

I\'m on a legacy project which contains hundreds of beans defin

1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-06 05:52

    Annotated beans will fail in the following cases:

    1. /WEB-INF/faces-config.xml is not declared to conform to JSF 2.0.

    2. @ManagedBean is of javax.annotation package instead of javax.faces.bean.

    3. Bean class is not been compiled/built into WAR's /WEB-INF/classes.

    4. Bean is packaged in a JAR file which is missing /META-INF/faces-config.xml.

    5. A wrong managed bean name is being used in EL, it should be the bean class name with 1st character lower cased according Javabeans spec. So in your particular example, #{fooBar} should work, but #{FooBar} won't.

    6. Webapp is actually using JSF 1.x libs (you can read JSF version in server startup log).

    0 讨论(0)
提交回复
热议问题