简体   繁体   中英

Is there any way to interface html with RCP(E4) application using Javascript?

I have html application with javascript api and I want to communicate and control RCP application via this javascript. What is the best approach to deal with such case.

HTML -> Javascript -> .... -> RCP (E4) application

More details added

Here I have an RCP calculator application. Where User Interface and the Logic (Background function) is implemented. Now the usecase is that user want to have Logic(background function) to be exposed to outside so that the HTML can be use javascript to make call to the logic (Background function). One problem is that the RCP application is already created and I dont want too much change to the RCP application. Rather just expose the functionality to be called from javascript.

One option I figured out is that I can have

HTML >> Javascript >> webserive call <<->> webservice >> RCP application.

Finally I resolved the problem with following approach:

HTML - Javascript <===> Java server (with Jetty/Jackson)

Client side:

  1. I made JQuery (ajax) call from the javascript to localhost:port
  2. Javascript objects converted to JSON before making ajax calls. (If you need dynamic data from server while using GET you can turn on the cache off).

Server side: listening to the port.

  1. I used Jetty (servlet embedded within the RCP application). Hence no apache configuration required.
  2. I used jackson (Jax-rs) to convert the JSON objects to java object and did the needed processing in RCP application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM