2014-07-22 2 views
0

@ManagedBean 및 @ViewScoped를 사용하여 JSF 2 관리 Bean에 주석을 추가했습니다. 그런 다음 Spring WebFlow flow.xml 파일에서; on-start와 on-entry와 같은 상태 변경 정의는 어떤 범위에서 관리 빈을 찾을 수 없다는 불평을 시작했다.누구나 JSF 2 ViewScoped 빈을 Spring WebFlow 2와 성공적으로 통합 했습니까?

Jul 22, 2014 11:04:43 PM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["http-bio-8080"] 
Jul 22, 2014 11:04:43 PM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["ajp-bio-8009"] 
Jul 22, 2014 11:04:43 PM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 32586 ms 
Jul 22, 2014 11:05:01 PM org.apache.catalina.core.StandardWrapperValve invoke 
SEVERE: Servlet.service() for servlet [springMVCServlet] in context with path [/opp] threw exception [Request processing failed; nested exception is org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [[email protected] targetAction = [[email protected] expression = serviceProviderSubscriptionBB.loadServiceProviderSubscription(subscriptionHeaderId), resultExpression = [null]], attributes = map[[empty]]] in state 'null' of flow 'service-provider-subscription' -- action execution attributes were 'map[[empty]]'] with root cause 
org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'serviceProviderSubscriptionBB' cannot be found on object of type 'org.springframework.webflow.engine.impl.RequestControlContextImpl' - maybe not public? 
    at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:215) 
    at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:85) 
    at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:78) 
    at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:48) 
    at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:84) 
    at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:114) 
    at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:105) 
    at org.springframework.binding.expression.spel.SpringELExpression.getValue(SpringELExpression.java:84) 
    at org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:75) 
    at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188) 
    at org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145) 
    at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51) 
    at org.springframework.webflow.engine.ActionList.execute(ActionList.java:154) 
    at org.springframework.webflow.engine.Flow.start(Flow.java:526) 
    at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:368) 
    at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:223) 



<on-start> 

    <evaluate 
     expression="serviceProviderSubscriptionBB.loadServiceProviderSubscription(subscriptionHeaderId)" /> 

</on-start> 

우리가 직면 한 또 다른 문제는 다음과 같습니다. @ViewScoped 빈에 대한 파괴 콜백이 호출되지 않습니다. 각기 다른 JSF 뷰에서 새로운 빈 인스턴스를 얻지 만, 기존의 빈 인스턴스와 종속 된 빈에 대한 힌트는 없다.

아무도 도와 줄 수 있습니까?

감사합니다.

+0

어떤 @ ViewScoped를 사용하고 있습니까? JSF 빈과 함께 CDI보기 범위를 사용할 수 없습니다. 또한 관리 Bean의 이름을 지정하거나 bean.xml 파일에서 선언하고 이름을 지정해야합니다. JSF의'@ ManagedBean' 대신 CDI의'@ Named'를 사용합니다. 왜냐하면 전자는 비난 받기로되어 있기 때문입니다. –

+0

어디서 실패했는지 코드를 보여주세요. – Prasad

+0

javax.faces.bean.ViewScoped. @Named를 사용하면 JSF 뷰에서만 사용할 수있게 할 수 있습니까? 그리고 WebFlow flow xml 파일의 상태 변경 정의 (시작시, 입력시, 렌더링시, 종료시 등)에서 해당 빈을 액세스 할 수 있습니까? – mrtbykkl

답변

1

흐름 파일은 Spring Bean을 사용하는 방법 만 알고 있습니다.

@Component('serviceProviderSubscriptionBB')으로 ManagedBean에 주석을 달고 Spring에서 처리하도록하거나, 플로우 전체에서 관리 Bean을 직접 선언 할 수 있습니다.이 방법으로 전체 플로우에서 클래스를 사용할 수 있습니다.

희망이 있습니다.