I\'ve been trying to hack up an annotated Spring MVC web app but it\'s proving p
ID: 646697 • Letter: I
Question
I've been trying to hack up an annotated Spring MVC web app but it's proving pretty hard to call a URL of my web app which fires a request to a remote API (UK Police data) and recieves a reply which I can then return as JSON. I've been trying to use Spring's RestTemplate.
The odd JavaScript example that I've glanced at does seem to be suited to that task a lot better and more simplistic than a full blown servlet. Is that an opinion that you also share and can back up with a good, clear simple example?
JavaScript does seem to provide a good platform for this kind of task
Or, in other words, is it simpler to create a "web-app" with JavaScript that does some REST calls and renders the response than trying to do it with Spring?
Explanation / Answer
Javascript and JSON do go hand in hand (JSON == JavaScript Object Notation after all).
You can use Javascript on the server side and it's becoming increasingly popular, (e.g. Frameworks like node.js are being used). However, Javascript has not been a long term proven technology in this space (let the howls of outrage begin), so it's a case of let the buyer beware.
Using Spring MVC, Java, .NET, PHP, Python etc on the server side to process JSON request/response should be fairly easy in 2013 (although sometimes much confusing documentation is lying around as the state of play has changed so much).
I'd post a question on stackoverflow with your specific Spring MVC issue - I suspect you'll get some good answers quickly there. Make sure you specify what type of request (GET/POST etc) and what version Spring MVC you are using.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.