Dear Wiki user, You have subscribed to a wiki page or wiki category on "Shale Wiki" for change notification.
The following page has been changed by Hermod Opstvedt: http://wiki.apache.org/shale/ShaleAndClayTutorial ------------------------------------------------------------------------------ 10. <option>[[BR]] 11. <textarea> </textarea>[[BR]] + This means that one can use these tags and add the Clay specifi attributes. Another thing to notice is that we have added a new symbol: @managed-bean-name. This symbol has special meaning in Shale/Clay. If we go back and look at the faces-config.xml file again, we will find the following declaration: + + <!-- Backing bean for page1 -->[[BR]] + <managed-bean id="page1">[[BR]] + <managed-bean-name>page2</managed-bean-name>[[BR]] + <managed-bean-class>[[BR]] + com com.acme.test.TestVC [[BR]] + </managed-bean-class>[[BR]] + <managed-bean-scope>request</managed-bean-scope>[[BR]] + </managed-bean>[[BR]] + What we do here is to define what is known as a backing bean or managed bean. This is a that Shale will make available to us. Shale uses an implicit mapping strategy to decide which beans it should instantiate for a given view. Since our page is called page1, it will then look for a managed bean with the same name and instantiate it. If you have a path to your page that spans several folders as in /foo/bar/pages/page1 then you need to define it as foo$bar$pages$page1 for Shale to find it and associate it with the page. + + Clay will when it sees the symbol managed-bean-name, replace it with the implicitly mapped bean that Shale is providing. In our case page1 + + Lets take a closer look at this bean (com.acme.test.TestVC). The first thing we notice is that it inherits from fra [http://shale.apache.org/shale-view/index.html/ AbstractViewController]. This class gives us some hooks (callbacks) into some Shale added lifecycle methods so that we can perform certain tasks that are relevant to that particular lifecycle. The next thing to notice is that is refers to a class Person. If you look in the faces-config.xml file again you will find the following declaration: + + <managed-bean id="person">[[BR]] + <managed-bean-name>person</managed-bean-name>[[BR]] + <managed-bean-class>[[BR]] + com.acme.test.Person[[BR]] + </managed-bean-class>[[BR]] + <managed-bean-scope>session</managed-bean-scope>[[BR]] + </managed-bean>[[BR]] +
