Annotations vs managed beans declarations in faces-config.xml

前端 未结 2 574
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-06 10:16

I\'m getting my hands on JSF 2.0 and have certain doubt about new annotation based auto-wiring (declaration of managed beans without any code in faces-config.xml).

A

2条回答
  •  离开以前
    2021-01-06 10:24

    As was said in Core JavaServer Faces (Third Edition):

    Before JSF 2.0, all beans had to be configured with XML. Nowadays, you have the choice between annotations and XML configuration. The XML configuration is rather verbose, but it can be useful if you want to configure beans at deployment time.

    Annotations allow rapid development and reduce redundant xml coding. Generally, it greatly depends on the project itself.

提交回复
热议问题