2 回答

TA贡献1802条经验 获得超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条经验 获得超5个赞
尝试这个:
@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;
}
添加回答
举报