Tuesday, September 18, 2012

Spring 3 MVC Internationalization & Localization (i18n & l10N) and Reloader

In this post I will discuss about Internationalization (I18N) and Localization (L10N) in Spring 3.0 MVC. 

What is i18n and L10n?

In computing, internationalization and localization are means of adapting computer software to different languages and regional differences. Internationalization is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes. Localization is the process of adapting internationalized software for a specific region or language by adding locale-specific components and translating text.
The terms are frequently abbreviated to the numeronyms i18n (where 18 stands for the number of letters between the first i and last n in internationalization) and L10n respectively, due to the length of the words. The capital L in L10n helps to distinguish it from the lowercase i in i18n. Let's begin:

Thursday, September 13, 2012

Intercepting requests (annotation based request mapping)

       Spring Interceptors has the ability to pre-handle and post-handle the web requests. Each interceptor class should extend the HandlerInterceptorAdapter class. Here we will create a Login Interceptor by extending the HandlerInterceptorAdapter class. You can override any of the three callback methods preHandle(), postHandle() and afterCompletion(). As the names indicate the preHandle() method will be called before handling the request, the postHandle() method will be called after handling the request and the afterCompletion() method will be called after rendering the view.

Tuesday, June 5, 2012

Difference between Oracle DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH LOCAL TIME ZONE

In Oracle there are four date&time datatype:
  1. DATE
  2. TIMESTAMP
  3. TIMESTAMP WITH TIME ZONE
  4. TIMESTAMP WITH LOCAL TIME ZONE
What is difference between this datatypes???

       TIMESTAMP datatype differs from DATE only with that it includes fractional seconds. But TIMESTAMP WITH TIME ZONE and TIMESTAMP WITH LOCAL TIME ZONE is more interesting :-)

Friday, May 25, 2012

Avoiding the "javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed" error

Hey folks,

today I'm gonna share one solution for a problem related to https hand-shake.

The SSLHandshakeException is thrown by java when the host you are trying to contact doesn't have a valid SSL certificate for that hostname.
For example, when I wanted to connect to the site which certificate details look like  "This CA Root certificate is not trusted because it is not in the Trusted Root Certification Authorities store." 

So when we are making a request to that site using java URLConnection it gives us an exception look like "javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed" . Then I did research for this problem and found a solution as follows:

Friday, April 6, 2012

Broken pipe and Transactional update cache is full

In your web applications u can see errors like following:
2012-04-06 10:01:05,031  WARN  [webscripts.connector.RemoteClient] [http-80-1] Exception during close() of HTTP API connection ClientAbortException:  java.net.SocketException: Broken pipe

Solution: In most situations this occurs when your client ajax connection is closed but response is ready. And server can't write response for client. In my case, I used YUI AJAX Get connection and set timeout "5000". When I see this warning message I increase timeout time to "300000" and log tail is happy now :)