Skip to main content

Posts

Sencha Touch - Flow Of Application Launch Function

 In Sencha Touch, we can include our application start up logic into following places, this is depending on our application situation.  1. Application default launch function. This launch function is triggered when all the dependencies are loaded successfully.  2. Controller init function.  3. Controller launch function.  4. Profile launch function.  Now I am going to include some code into all the places. Let's see what will happen.  I have created simple controller called "TestController" as shown in figure and I simply printed different message in both init and launch function.  I have created the simple profile called "TestProfile" and I simply printed message in launch function. By default this profile is active.  Now I am going to include my controller and profile into app.js and I am going to simply print different message in application launch function. This is my app.js code.  Ok let's create an in...

Simple Login Application Using Spring MVC and Hibernate – Part 2

 I hope you have visited my part1 of my tutorial . Let’s see the steps for integrating hibernate framework into Spring MVC. Here I have used MySQL database. I have created one database called “ springmvc ” and created one table called “ user ” with userid, username, password fields.  I have inserted some records into table like this. Step 1: Creating User POJO class.  We need to create a User POJO class for mapping user table. Ok let’s create it. Step 2: Creating hibernate mapping xml file for user class.  In hibernate we need to create hibernate mapping xml file for all domain class for mapping into corresponding database table. Instead of creating xml file you can use annotation for mapping domain class into database table. This is my mapping xml document created for mapping our user domain class into user database table. Step 3: Creating authenticate service class.  The method “verifyUserNameAndPassword” pres...

Simple Login Application Using Spring MVC and Hibernate – Part 1

 I hope developers working in web application development might hear about MVC architecture. Almost all technologies provide support for MVC based web application development, but the success is based on many factors like reusable of the code, maintenance of the code, future adaption of the code, etc..,  The success of the Spring MVC is “ Open for extension and closed for modification ” principle. Using Spring MVC the developers can easily develop MVC based web application. We don’t need any steep learning curve at the same time we need to know the basics of spring framework and MVC architecture. The Spring MVC consists of following important components. 1. Dispatcher servlet 2. Controller 3. View Resolver 4. Model Spring MVC - Overview  The overall architecture of Spring MVC is shown here.  1. When “Dispatcher Servlet” gets any request from client, it finds the corresponding mapped controller for the request and just dispatches the request to the c...

JSF2 - h:dataTable Demo using HashMap

 The data table component in JSF2 is used for displaying database table, array list, hash map, etc.., into tabular format. In JSP, if you want to display a table record in tabular format, we need to create a html table template after that we need to iterate the result set object. Here that is not necessary, because the h:dataTable automatically create a table template based on your inputs as well it have lot of useful attributes for specifying style class for HTML tags like table, th, tr and td.  This is very simple use case of h:dataTable. Here I am using HashMap, Inside the hash map I have all country name as key and corresponding capital name as value. Now I am going to display that hash map into tabular format using h:dataTable component.   The rowClasses, columnClasses, header and footer classes are very useful attributes used for define your own css...

JSF2 - Number Converter Demo

 The number converter in JSF2 is used to convert a component data into java.lang.Number format. Additionally it have lot of attributes for customizing number format. The sample usage is given here.  The important one is, the numberConverter binding component managed bean property should be a primitive type or has a type of java.lang.Number only. Here the "number" type is java.lang.Number. This is another usage of number converter.  THe result of the above code is something like $22.50. The sample application is available in Github .

JSF2 - Date Time Converter Demo

 The date time converter in JSF2 is used to convert a text value into java.util.Date value. The date time converter has several attributes, that is used to specify the format and type of data. The most used formats are locale, timeStyle, for, timeZone etc.., The example usage is given here. Please enter a date in dd/mm/yyyy format  The sample application is available in Github .

JSF2-Integer Converter Demo

 The Integer converter in JSF2 is used to convert a text value into integer value. This is my managed bean, here I have declared one Integer variable and I have created accessor method for that variable. package com.pointerunits; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; @ManagedBean @SessionScoped public class Converter { private Integer intNumber; public Converter() { } public Integer getIntNumber() { return intNumber; } public void setIntNumber(Integer intNumber) { this.intNumber = intNumber; } }  This is my xhtml page, Here I have created one input text filed and converted that field value into integer using integer converter. If converter can't able to convert then it't will display the error message.  You can download an entire application from github .