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" />
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.