2 回答

TA貢獻1802條經(jīng)驗 獲得超10個贊
您可以嘗試這個(在您指出的項目的自述文件中):
import java.util.HashMap;
import java.util.Map;
import com.github.jneat.jsf.ViewScope;
import org.springframework.beans.factory.config.CustomScopeConfigurer;
import org.springframework.context.annotation.Configuration;
@Configuration
public class MyViewScope {
@Bean
public CustomScopeConfigurer customScopeConfigurer() {
CustomScopeConfigurer configurer = new CustomScopeConfigurer();
Map<String,Object> scopes = new HashMap<String,Object>();
scope.put("view", new ViewScope());
configurer.setScopes(scopes);
return configurer;
}
}
你也可以看看這個問題

TA貢獻1993條經(jīng)驗 獲得超6個贊
嘗試這個:
@Bean
public CustomScopeConfigurer customScope(WorkflowScope viewScope) {
CustomScopeConfigurer configurer = new CustomScopeConfigurer();
Map<String, Object> viewScope = new HashMap<>();
viewScopeSet.put("view", viewScope);
configurer.setScopes(viewScopeSet);
return configurer;
}
添加回答
舉報