I need clarification on how client-server architecture should function for a modern web application with a RESTful backend.
For a web app, the client is typically the browser while the server is the web server. Programatically speaking, there are components like client-side code (view), server-side code (controller/model), and the database. Is my understanding accurate?
So when the client-side code sends a request to the RESTful server-side code, should the server return a JSON/XML object instead of a simple output? Am I correct in this assumption?
If the client-side code cannot use any server-side code to reload the webpage, how would it parse the JSON/XML object back into the page? Would it require a JavaScript library loaded into the browser, such as Ajax? And if we want to reload the entire webpage, would JavaScript be used for that purpose?
Edit:
In a scenario where the web server is separate from the backend application server, should the client-side code call the web server to route to the backend or directly call the backend server when accessing a RESTful service?