Is there any way to communicate between front-end js and java besides ajax?

now there is a need for
to interact with each other without using ajax (that is, to transfer data and call the local database to verify things), because the service cannot be started because of the cost. When I search for categories on the Internet, most of them are mobile (andriod),. There is a webview that can help achieve this function, but my project is on PC, so I"d like to ask the big god:

1, can the PC end interact with each other by avoiding ajax ?

2. Can the front-end js connect to the database directly? Most of the information I found is realized under IE. Is there any other general method?

my colleagues at the background ask others for advice, and the solution is to encapsulate the browser with swing , and then let me find a browser plug-in or something, but I have no idea about the front-end js. I don"t understand how js can call the java method. Isn"t js running in a browser environment?

the front end of the project uses vue , and the background uses java + ssm + sql server .

Apr.11,2021

  1. websocket
  2. indexDB

the front end is responsible for displaying user interaction, and data storage should not be done directly by the front end

you just need to make this requirement directly into the client


Why can't the local side start the service? Using localhost to access, there are other solutions, but it certainly doesn't work well


websocket


node.js to learn about

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36c03-2c01f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36c03-2c01f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?