/
Add custom Java class to a back end project
Convertigo Public Knowledge base
Add custom Java class to a back end project
Custom Java classes can be added to a project as JAR files in the <project>/libs or <workspace>/libs folders.
You can already use the native Java 1.8 classes in a SequenceJS step.
var md5 = use("org.apache.commons.codec.digest.DigestUtils.md5hex");
log.message("md5: " + md5("hello world"));
The use
can be used to load a native Java function and speedup the loading of this function for next calls.
The idea is to share memory between multiple request, cross sessions.
This can be useful in some case, to keep global object or function.
var myfun = project.get("myfun");
if (myfun == null) {
myfun = function (a, b) {
return a + b;
}
project.set("myfun", myfun);
}
myfun(1, 2);
The server
object works like project
but global to the server.
See more details here https://doc.convertigo.com/documentation/latest/reference-manual/convertigo-mbaas-server/javascript-objects-apis/#methods-detailed-list-1
Related content
HTTP Session Timeout between multiple projects call
HTTP Session Timeout between multiple projects call
More like this
Execute a sub Sequence asynchronously
Execute a sub Sequence asynchronously
More like this
Use multi-valued variables in Sequence
Use multi-valued variables in Sequence
More like this
Caching Convertigo Back End response
Caching Convertigo Back End response
More like this
How to address a step variable in JS expression?
How to address a step variable in JS expression?
More like this
How to call a Function in a JavaScript file (*.js) that has been added into the Project path?
How to call a Function in a JavaScript file (*.js) that has been added into the Project path?
More like this
(c) Convertigo 2023 https://www.convertigo.com