(JavaScript) to Java servlet

Inserts a new record in table `usermanagement`.`logger`, by running the Javascript that calls the com.wa.usermanagement.server.servlet.logger  and function of it doLogger(); and return through javascript an ok string.

This is an example that shows how to call Java Servlets from JS (Smartclient.)

Java Servlet class

package com.lynvcode.server.servlet;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import com.lynvcode.server.DBConnection;
public class logger {
    public String doLogger() {

        Connection conn = DBConnection.getConnection();
        int rest;
        String query = "INSERT INTO `logger` (`pk`, `logger`) VALUES (NULL, 'test2');";
        Statement s = conn.createStatement();
        rest = s.executeUpdate(query);
        if (rest != 0){
            return "test2 ok";
        }catch (Exception e) {
        return "test2 not ok";


Javascript function that calls the servlet.{
           appID: "builtinApplication", // must be under webcontent/apps/
           className: "com.lynvcode.server.servlet.logger",
           methodName: "doLogger",
           requestParams: {
               actionURL: "/project_name/project_name/sc/IDACall", //folder under which the IDACall resides in (see logs of catalina or ./ thingy output after loading a page in smartgwt
               containsCredentials: true,
               params : {
           callback : function (response, data) {

               if (response.status == isc.RPCResponse.STATUS_SUCCESS) {
               } else {
       }); file under webcontent/app/ or maybe webcontent/shared/app, depends on your files, check your app folder location.

        <ServerObject ID="logger" className="com.lynvcode.server.servlet.logger">
                <method name="doLogger"/>