Obtaining the specific object from the application, some configuration of the information taken from the subject



public class BeanHolder {
public BeanHolder() {
}

public static Object getBean(String beanId) {
WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(ApplicationContext.getContext().getServletContext());
return ctx.getBean(beanId);
}
}

 <bean id="uploadProperty"
class="com.ibm.gbs.ai.portal.framework.common.upload.domain.UploadProperty">
<property name="savePath" value="/upload/file/" />
</bean>
UploadProperty up = (UploadProperty) BeanHolder.getBean("uploadProperty");
path = up.getSavePath()+"template/" + editFileName;

Guess you like

Origin www.cnblogs.com/fuerming/p/10938108.html