Announcement

Collapse
No announcement yet.

JSF + Spring / AOP

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • JSF + Spring / AOP

    Hi,

    ich habe ein kleines Problem, wenn ich versuche JSF mit Springs AOP auszufuehren.
    Hier ist ersteinmal meine spring.xml:
    Code:
    <beans>
    
    	<!-- Bean Classes -->
    	<bean id="beanTarget" class="BusinessLogic" />
    	
    	<!-- Advice classes -->
    	<bean id="theTracingBeforeAdvice" class="TracingBeforeAdvice" />
    	
    	<!-- Bean Config -->
    	<bean id="businesslogicbean" class="org.springframework.aop.framework.ProxyFactoryBean">
    		<property name="proxyInterfaces">
    			<value>IBusinessLogic</value>
    		</property>		
    		<property name="target">
    			<ref local="beanTarget" />
    		</property>
    		<property name="interceptorNames">
    			<list>
    				<value>theTracingBeforeAdvisor</value>
    			</list>
    		</property>
    	</bean>
    	
    	<!-- Advisor pointcut defintion for before advice -->
    	<bean id="theTracingBeforeAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor" >
    		<property name="advice">
    			<ref local="theTracingBeforeAdvice" />
    		</property>	
    		<property name="pattern">
    			<value>.*</value>
    		</property>
    	</bean>
    	
    </beans>
    In der BusinessLogik-Klasse gibt es eine Funktion, die ich aufrufe, wenn in meiner faces-Datei ein command-Button gedrueckt wird:

    Code:
    <h:commandButton action="#{beanTarget.foo}"/>
    In der foo-Funktion wir System.out.println aufgerufen.

    Die TracingBeforeAdvice implementiert die Schnittstelle org.springframework.aop.MethodBeforeAdvice und somit auch die Funktion before(....). Auch hier wird System.out.println(...) aufgerufen.

    Mein Problem ist jetzt, dass die Methode foo zwar aufgerufen wird, die Funktion before aber nicht...

    Ich habe das Beispiel von http://www.onjava.com/pub/a/onjava/2...springaop.html, habe aber das AfterReturningAdvice weggelassen...


    Hat hier jemand erfahrung mit AOP und evtl. eine Idee

    Danke schonmal im Vorraus
Working...
X