Announcement Announcement Module
Collapse
No announcement yet.
Best practise Spring Bean initialisation with JSF Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best practise Spring Bean initialisation with JSF

    Hi there,
    I have got question regarding how and where to implement the
    initilisation of SpringBeans in a JSF Application. Let me first please explain
    my issue I got. I create the base DAOs and put a service layer above it.
    Similiar procedure as used in appfuse.
    A normal service bean in my applicationContext has the following
    structure:
    Code:
    	<bean id="systemTypeService"
    		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    		<property name="transactionManager">
    			<ref local="transactionManager" />
    		</property>
    		<property name="target">
    			<ref local="systemTypeManager" />
    		</property>
    		<property name="transactionAttributes">
    			<props>
    				<prop key="find*">
    					PROPAGATION_REQUIRED,readOnly,-OrderException
    				</prop>
    				<prop key="save*">
    					PROPAGATION_REQUIRED,-OrderException,-OrderMinimumAmountException
    				</prop>
    			</props>
    		</property>
    	</bean>
    	
    	<bean id="systemTypeDAO"
    		class="itecon.bo.dao.hibernate.SystemtypeDAOHibernate"
    		abstract="false" singleton="true" lazy-init="default"
    		autowire="default" dependency-check="default">
    		<property name="sessionFactory">
    			<ref local="sessionFactory" />
    		</property>
    	</bean>
    
    	<bean id="systemTypeManager"
    		class="itecon.service.impl.SystemtypeManagerImpl">
    		<property name="systemTypeDAO">
    			<ref local="systemTypeDAO" />
    		</property>
    	</bean>

    Now I want to create a SearchHandler.java to handle the post event of
    searchSystemtype.jspx. Do I have to create a BasePage.java or something
    like that to implement the initialisation of the systemTypeManager?

    What also would be possible is to put the initialisation of all managers in to a jsf bean managed by application scope or?

    Thanks a lot for your help.
    Would be nice if you could provide some examples.

    Regards Johannes
Working...
X