Search code examples
javajavascriptclient-sideibm-mobilefirstworklight-adapters

How to use java on client-side code of Worklight?


I'm working with a worklight project (Hybrid application),
Currently i'm calling server-side adapter with JavaScript and handling fetched data with JavaScript and having many problem of parsing data.
Can anybody help me to use JAVA at client-side programming(Anyhow if possible)?


Solution

  • You cannot use Java for client side programming. If you're creating an Android application, then of course you can implement whatever you want in java and then use cordova to pass your data down, but it doesn't look like thats what you want to do.

    I would take a different approach though. You say you're using a server side adapter, and adapters can use custom Java code. You should use your server side adapter to get your data from the backend, then add your custom java code and parse the data in the adapter. Once your data is parsed and in a consumable format, then you can pass the data from the adapter to the client.

    Here is the documentation for using java in an adapter.