Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The example below uses Form Element Plugin as example, although the interface can be used with any other Plugin Types

Code Block
package org.joget.sample.lib;

import java.io.IOException;
import org.joget.apps.form.model.Element;
import org.joget.plugin.base.PluginWebSupport;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SimpleFormElement extends Element implements PluginWebSupport {

    //... Other Implemented Methods ...

    @Override
    public void webService(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {


        // Get Parameter
        String text = request.getParameter("say_something");


        // Write to response
        response.getWriter().write(text);
    }
}

After you 've done do your Web Service implemetationimplementation, you may access it using the URL format shown below:

...

There are 2 JSON APIs available in this sample plugin:

1. User List

Code Block
{Context Path}/web/json/plugin/sample.JsonApiPlugin/service?action=userList&orgId={Organization Id}

...