This tutorial explains How to create an asynchronous HTTP call in JAVA. What is asynchronous HTTP call? Asynchronous HTTP Request call allows us to process an HTTP call using non-blocking I/O in a separate thread. The main use for Asynchronous HTTP call is where the client is calling a server with a delayed response, which may result in the client ... Read More »
SSL handshake alert: unrecognized_name Exception
This tutorial explains how to handle SSL handshake alert: unrecognized_name exception while calling an URL over SSL/https . When I tried to connect a web-server over SSL, I was getting the below error continuously. This happened with JDK1.7 and above. Below is the sample Java programme which I was running. Issue : Exception I was getting - Solution : After ... Read More »
Using strict mode to write secure Javascript
Using strict mode to write secure Javascript We know that doing read operation from undeclared variable gives error in Javascript, whereas doing write operation to an undeclared variable is fine and the variable gets the global scope (I will discuss this in a different post as to why this happens in Javascript). Now, lets take stock of a situation in ... Read More »
How to configure sessioncookie at Tomcat server level OR at Application level (web.xml)
How to configure session cookie at Tomcat server level or at Application level (web.xml) In this post we will see how to configure session cookie at Tomcat server level or at application level using web.xml You can use either way to set a cookie. Tomcat server Go to -> conf directory -> open context.xml -> add below lines:- <Context sessionCookieName="<yourCookieName>" ... Read More »
Some useful flags (N, NC and QSA) for Apache server rewrite rules
Some useful flags (N, NC and QSA) for Apache server rewrite rules There are many flags available for Apache rewrite rules. Here we will talk about 3 useful flags- N, NC and QSA N|next-> [N] or Next flag causes the ruleset to start over again from the top. Use with extreme caution, as it may result in loop. NC|nocase-> [NC] ... Read More »
Javascript Browser back button handling
Javascript Browser back button handling In Javascript getting handle of browser back button event is complex. There are many plugIns available to satisfy this complex need. However, I cam across a solution which to some extent can resolve this issue. if (window.history && window.history.pushState) { if(location.hash.split("#")[1]!='search'){ window.history.pushState('forward', null, '#search'); } } This piece of code will first do a forward ... Read More »
URL shortening using google API
URL shortening using Google API Sometimes we need to share a long URL or we need to tweet them. But because of the length of the URL we are not able to do so. Google provides a service using which we can convert our long URL and squeezes them to fewer character URL. This service of Google is also known ... Read More »
GSON encoding the string like \u003d
This tutorial explains how to handle the encoding issue by using GSON. Below is a sample program in which GSON was converting string, with some special character, into some encoded character. But when we printed the GSON string it gave some different output other than what was supposed to be. The issue with the above code is GSON is encoding ... Read More »
Integration of Android Studio and Git
This tutorial explains how to use Git Version Control with Android Studio. Git is a distributed version control system. Git is a best choice among all the version control software like CVS, SVN etc. Android studio comes with Git client. All we need to do is just enable and start using it. As a prerequisite, we need to have Git ... Read More »
How to encode decode String in Java base64 Encoding
Base64 Encoding Algorithm Base64 encodes String using an algorithm which uses 64 printable characters to replace each character in original string in an algorithmic sequence so that it can be decoded later. Base64 encoding prevents misuse of data by encoding it into ASCII format. Base64 is real simple and easy to use for simple encoding needs. There are more advanced ... Read More »
Jkoder.com Tutorials, Tips and interview questions for Java, J2EE, Android, Spring, Hibernate, Javascript and other languages for software developers