Bean configuration tag

From CauchoWiki

Jump to: navigation, search

[edit] See Also

Inversion of Control

[edit] directives

directivedescription
initBlock of Inversion of Control setters
jndi-nameJNDI name to store the bean
local-transaction-optimizationFor transactional beans, use the local transaction optimization when possible
mbean-interfaceJava interface exposing the bean's management interface
mbean-listenerRegisters the bean to listen for JMX events
mbean-nameJMX name to store the bean
typeThe Java class of the bean
varEL variable to store the bean

[edit] example

...
<bean var="movie"
      type="com.foo.MyMovie">
  <init>
    <name>Fellowship of the Ring</name>
    <director>Peter Jackson</director>
  </init>
</bean>


...
<servlet servlet-name="movie-display"
         servlet-class="com.foo.MovieServlet">
  <init>
    <movie>${movie}</movie>
  </init>
</servlet>
Personal tools