I thought I could launch a method from within the client to call a SHC who can do the job.
In fact, I created the copying method, the jsp page and a simple method that, using a showURL instruction, invokes the copying method to be executed from SHC.
I worked. But...
It seem that the execution depends on browser's cache: if I launch it twice, the second time won't work unless I clear the cache.
Is there a way to avoid this problem (maybe closing the connection right after the execution of the method, but I'm open to all suggestions)...
The jsp code I'm using is:
- Code: Select all
<%@ page import = "java.util.*" %>
<%@ page import = "com.servoy.j2db.server.headlessclient.*" %>
<%@ page import = "com.servoy.j2db.dataprocessing.IDataSet" %>
<%@ page errorPage="errorpage.jsp" %>
<%
ISessionBean servoy_hc = (ISessionBean)session.getAttribute("servoy");
if (servoy_hc == null)
{
servoy_hc = HeadlessClientFactory.createSessionBean(request,"testsolution");
session.setAttribute("servoy",servoy_hc);
}
boolean ok = servoy_hc.setMainForm("documents");
String result = (String)servoy_hc.executeMethod(null,"copyFile",null);
%>[quote][/quote]