Spring 4.x/3.x (Web MVC) REST API and JSON2 Post requests, how to get it right once for all?

CURL Post call curl -i -H “Content-Type: application/json” -X POST -d ‘{“id”:100,”username”:”JohnBlog”,”name”:”John”,”lastName”:”Blog”,”email”:”[email protected]”}’ http://localhost:8080/[YOURWEBAPP]/api/user/add Different Error Scenarios: Here I explore different errors you might come across after you have made a curl call and what might have possibly gone wrong. Scenario One: HTTP/1.1 404 Not Found Server: Apache-Coyote/1.1 Content-Type: text/html;charset=utf-8 Content-Length: 949 Date: Tue, 04 Jun … Read more

PHP Warning: move_uploaded_file() unable to move

Change upload permissions for /var/www/media2net/uploads/ either by changing owner with “chown” or by “chmod” Examples $ sudo chown apache:apache /var/www/media2net/uploads/ $ sudo chmod 755 /var/www/media2net/uploads/ Also, if downloaded_file.png already exists in that directory and it’s owned by another user, then you would need to change ownership on that file as well. $ sudo chown apache:apache … Read more

Force JSF to refresh page / view / form when opened via link or back button

That page is likely being loaded from browser cache. This is essentially harmless, but indeed confusing to the enduser, because s/he incorrectly thinks that it’s really coming from the server. You can easily confirm this by looking at the HTTP traffic monitor in browser’s web developer toolset (press F12 in Chrome/FireFox23+/IE9+ and check “Network” section). … Read more