java - JSF 2.0 Problem (faces-config) -


We have faces-config.xml in JSF 1.0, where we talk about managed beans, dependencies Enter & amp; Navigation etc.

I was developing a sample project that was using JSF 2.0. But, as I do not know the annotation, I must include the face-config.xml externally. Please provide a solution for this, as we do not have to include it in JSF 2.0 . What is the reason behind this? How do we set beans in the form of managed bean? What is annotation? How is this used?

(...) In JSF 2.0 we do not need it to include it What is the reason behind this?

In three words: There is just a few codes to write the ease of development - the boilerplate code is removed, whenever possible the default is used, and the use of annotations is the deployment descriptor Is used to reduce the need.

How do we set up managed bean as Bean? What is annotation? How is this used?

Managed beans are identified using the @ ManagedBean annotation. Bean's scope is also specified by the annotation ( @RequestScoped , @syncocked , @ApplicationScoped , etc.).

Then in JSF 1.0 the following:

   & Lt; / Successful bean>  

JSF 2.0 can be rewritten in:

  @ManagedBean @ session Public Scooter Foo {// ...}  < / Pre> 

and it is specified in a face page:

  & lt; H: Input text label = "eMailID" id = "emailId" value = "# {foo.email}" size = "20" required = "true" />  

(By default, the name of the managed bean will be the name of the annotated class, with the first letter of the class in lowercase.)

See also


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -