當前位置: 首頁>>代碼示例>>Java>>正文


Java OpenmrsClassLoader類代碼示例

本文整理匯總了Java中org.openmrs.util.OpenmrsClassLoader的典型用法代碼示例。如果您正苦於以下問題:Java OpenmrsClassLoader類的具體用法?Java OpenmrsClassLoader怎麽用?Java OpenmrsClassLoader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OpenmrsClassLoader類屬於org.openmrs.util包,在下文中一共展示了OpenmrsClassLoader類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import org.openmrs.util.OpenmrsClassLoader; //導入依賴的package包/類
/**
 * Overriding the init(ServletConfig) method to save the dwr servlet to the ModuleWebUtil class
 */
public void init(ServletConfig config) throws ServletException {
	Thread.currentThread().setContextClassLoader(OpenmrsClassLoader.getInstance());
	
	DwrServletConfig conf =  new DwrServletConfig(config.getServletName(), config.getServletContext());
	conf.setInitParameter("debug", "false");
	conf.setInitParameter("crossDomainSessionSecurity", "false");
	conf.setInitParameter("config-modules", "/WEB-INF/dwr-modules.xml");
	
	super.init(conf);
}
 
開發者ID:openmrs,項目名稱:openmrs-module-legacyui,代碼行數:14,代碼來源:OpenmrsDWRServlet.java

示例2: getProcess

import org.openmrs.util.OpenmrsClassLoader; //導入依賴的package包/類
/**
 * Used to get the configuration objects
 * @return
 */
public Process getProcess() {

	Process process = null;
	try {
		Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
		process  = (Process) jaxbUnmarshaller.unmarshal(OpenmrsClassLoader.getInstance().getResourceAsStream("process.xml"));

	} catch (JAXBException e) {
		e.printStackTrace();
	}
	return process;
}
 
開發者ID:openmrs,項目名稱:openmrs-module-dataimporttool,代碼行數:17,代碼來源:ProcessReader.java

示例3: testUploadofNotaZipArchieve

import org.openmrs.util.OpenmrsClassLoader; //導入依賴的package包/類
/**
 * Test of upload method, of class AddAppController.
 */
@Test
public void testUploadofNotaZipArchieve() throws Exception {
	HttpServletRequest request = new MockHttpServletRequest(new MockServletContext(), "POST", "/module/owa/addApp.htm");
	URL url = OpenmrsClassLoader.getInstance().getResource("testing");
	MockMultipartFile multifile = new MockMultipartFile("testFile", "testing", null, new FileInputStream(url.getFile()));
	AddAppController controller = (AddAppController) applicationContext.getBean("addAppController");
	controller.upload(multifile, request);
	Assert.assertEquals("owa.not_a_zip", request.getSession().getAttribute(WebConstants.OPENMRS_ERROR_ATTR));
}
 
開發者ID:openmrs,項目名稱:openmrs-module-owa,代碼行數:13,代碼來源:AddAppControllerTest.java


注:本文中的org.openmrs.util.OpenmrsClassLoader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。