As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
public void execute(WebScriptRequest webscriptRequest, WebScriptResponse webscriptResponse) throws IOException { String xmlResponse = null; xmlResponse = Utiles.ejemploMetodoEnOtraClase(); webscriptResponse.getWriter().write(xmlResponse); }
public class AlfrescoAppContext { private static ApplicationContext ctx; /** * Injected from the class "ApplicationContextProvider" which is automatically * loaded during Spring-Initialization. */ public static void setApplicationContext(ApplicationContext applicationContext) { ctx = applicationContext; } /** * Get access to the Spring ApplicationContext from everywhere in your Application. * * @return */ public static ApplicationContext getApplicationContext() { return ctx; } }
public class AlfrescoAppContextProvider implements ApplicationContextAware { public void setApplicationContext(ApplicationContext ctx) throws BeansException { // Wiring the ApplicationContext into a static method AlfrescoAppContext.setApplicationContext(ctx); } }
<bean id="alfrescoApplicationContextProvider" class="<aqui el paquete de la clase>.AlfrescoAppContextProvider" />