Configure HTML/JavaScript

Thursday, April 14, 2016

How to add request body to http Delete method


Http Methods methods:


While consuming web services, many tume we need to call http put, delete, get, post methods. While calling http het and post methods are regularly used and you need minimal configuration, put, delete, etc methods some time confuse developer.

Problem with Http Delete methods:


In case of http delete methods, we cannot send request body if your are using http client. it does not allow to do as there is no methods avaialble.

You will face this problem in case you are developing an application where you web service end point need some data in the delete methods and in clent there are no ways to do that.

Soloutions:


The solution is to extend the http post method and change the method to DELETE while sending data. One of the easiest way I would suggest is as below.

Extend the HttpPost method and change the method to DELETE as below and then create the object of HttpPost rather HttpDelete.


Monday, April 11, 2016

How to remove java 1.8 from class path and set java 1.7 in windows 10



Windows 10 degrading from java 1.8 to java 1.7


I have been developing a project which is on google app engine and java sdk 1.7. When I upgraded to windows 10 from my windows 7 machine, the by default java verion was jre 1.8 and when ever I have bed executing any task, the version miss matching was happening.

JDK:

 jdk and jre are 2 different thing. The jdk is responsible to compile your java code using javac compailer and generate .class file which contains java byte code which is executed in jvm(java virtual machine)

JRE:

jre is something which execute the class file and guve you the result. any operating system gives you jre not jdk as jre executes most of the internal java codes


How to chge default windows 10 jre version from java 1.8 to 1.7



In windw 10, the C:\Windows\System32 (c:\Windows\SysWOW64 folder if you have x64 system [Win 7 64 bits]) folder contains java.exe, javaw.exe and javaws.exe which is dafault java execution and any call path you will set for the java will not over ride it as these are highest priority in windows.To set you default path to java jre 1.7 you need to delete them. may be you can take a backup in case you want to come back to jre 1.8.then what ever class path jre and jdk is available, it will point to you java version in your machine.