我想从下面提供的XML bean中用java创建一个bean。它是用于endeca发现服务的bean
<bean id="httpServletRequest" scope="request"
factory-bean="springUtility"
factory-method="getHttpServletRequest" />
答案 0 :(得分:0)
最后,我找到了方法
@Bean
@Scope("singleton")
public SpringUtility springUtility()
{
return new SpringUtility();
}
@Bean
@Scope("request")
public HttpServletRequest getHttpServletRequest()
{
return springUtility().getHttpServletRequest();
}