Hello. I am writing a project on Spring, it has the aplication.properties configuration file in the standard project resource folder. Can I open it and change it after the project is already compiled and installed on glassfish? I want to change the configuration settings without recompiling the project every time. How can i do?
And one more question. The project does not work well Ajax request. Here is the web page.
<a href="javascript:void(0)" onclick="sendCommand('Start')" >запустить</a> <p> ответ от сервера : <span id="programmAnswer"> </span></p> <script> var programmAnswer = document.getElementById('programmAnswer'); function sendCommand(url) { statePrinter.innerHTML = ""; var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.send(); xhr.onreadystatechange = function () { if (xhr.readyState !== 4) { return; } if (xhr.status !== 200) { programmAnswer.innerHTML = ' произошла ошибка при получении статуса'; } else { programmAnswer.innerHTML = xhr.responseText; } } } </script>
here is the controller:
@ResponseBody @RequestMapping(value = "Start" , method = RequestMethod.GET, produces={"application/json; charset=UTF-8"} ) public String qwe() { return thread.setStart() ? "программа запустилась." : "программа уже работает."; }
At first this JS code was on a regular Web servlet project and it worked great. But when interacting with the spring, it does not work correctly and can not even be explained
On one computer under windows, it does not work and returns 404. And on another computer on Linux and from the phone, everything works correctly and returns 200. Maybe someone knows why this code behaves so mysteriously?