Okay, so you have a json file somewhere, that was already created by someone else, by another project or just due to quantum fluctuation… doesn’t matter, what you want is to read that file, read the json, add another property to that json and then write the entire json back to the file.
Of course it’s not that complicated and can be done in so many ways. I saw a lot of projects that were doing this by simply manipulating the string. This is certainly not recommended since it’s pretty easy to screw up the integrity of that json object.
Instead let’s see one of the easiest and safest way to do it:
Today we are going to see how you can download a zip file, unzip the contents, browse the contents and inspect any file. On top of that, for a more practical example, we are going to parse a json file and deserialise its content into a java object:
This is not a Spring MVC tutorial. I think there are plenty of those on the internet. I just want to show you how you can enable MVC support and create an API for your app.
Sometimes you might have a simple Spring app or even a JSF+Spring web app and want to expose an API. One way to do this is to use Spring MVC Controllers. It takes only 1 minute, I promise.
This is like a black hole out there… Nobody can tell you exactly the answer. But the answer is not simple at all…
Ok, first of all, there’s a pretty big difference between how the size is calculated for GitHub.com and for GitHub Enterprise.
The short answer is that the size shown doesn’t match the repo’s size after clone. The size shown is as close as possible to the .git folder present in your repo.
I know, it’s hard to use the Spring Security Facelets Tag Library, the namespace is always invalid, not working etc. Search no more…
Here is what you need to do:
This is a template project using latest Spring 3.2, latest JSF and latest Primefaces. It’s not just a hello world. It has some jsf templating in place, spring components, lombok annotation, primefaces interaction.
The project is using the port 9996. You also need JAVA 7 for it to run!
I also included a script, startTool.sh that does the entire deploy and run as easy as possible for you.
If you have anything you want to add to the tool or any other template you think might make your life easier then just leave a comment with these nice fantasies 🙂
For the source code go here: https://github.com/spauny/spring-jsf-primefaces-template
or just do git clone email@example.com:spauny/spring-jsf-primefaces-template.git