How to accurately determine whether a request is a `Ajax` request or a traditional `URL` request in Java?

the test uses the handler method to determine that it does not work. Front and back code:

request.getHeader("X-Requested-With")

whether it is url access or fetch asynchronous access, you will only get null !

Apr.09,2021

this requires the cooperation of the front desk.
you just add X-Requested-With http headers when you fetch.
jQuery's ajax requests are all


fetch('http://localhost:8181/1',{
headers:{
    'X-Requested-With':'XMLHttpRequest'
}
})
with this header added.
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-1b3e479-347c8.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-1b3e479-347c8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?