The Spring Framework is an open source application framework that aims to make J2EE development easier. Unlike single-tier frameworks, such as Struts or Hibernate, Spring aims to help structure whole applications in a consistent, productive manner, pulling together best-of-breed single-tier frameworks to create a coherent architecture.
How does @ModelAttribute work?
@ModelAttribute is a Spring-MVC specific annotation used for preparing the model data. It is also used to define the command object that would be bound with the HTTP request data. The annotation works only if the class is a Controller class (i.e. annotated with @Controller).
ModelAttribute can be applied on both methods as well as method-parameters. It accepts an optional "value", which indicates the name of the attribute. If no value is supplied to the annotation, then the value would be defaulted to the return type name in case of methods and parameter type name in case of method-parameters.
Thursday, October 18, 2012
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?
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:
- DATE
- TIMESTAMP
- TIMESTAMP WITH TIME ZONE
- 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:
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:
Subscribe to:
Posts (Atom)