April 14, 2017

Employee Management System using spring MVC

Employee Management System using spring MVC

Description : The project is developed using Spring MVC 3 frameworks, JSP, Servlets, JQuery, JSTL, Ajax, JSON, FTL, HTML5  Mysql With Google Map integration. IDE used Eclipse Java EE IDE for Web Developers. Version: Indigo Service Release 2

stored procedures are used.

Branch Details

Working on the project

Daily attendance details

Attendance excel reports  sample report

contact me at 8281808029


April 03, 2017

MySql sample stored procedures

if else update insert stored procedure


    /*[DEFINER = { user | CURRENT_USER }]*/
    PROCEDURE `cfedapps`.`p_save_branch`(in branchId int(50),in branchCode int(5),in branchName varchar(55),in address varchar(55),in district varchar(33),in pincode bigint(10),in landline bigint(15),in startDate date,in lat long,in lon long, in branchStatus varchar(5), in branchDesc varchar(55),in userId int(4), in imgUrl varchar(55),in branchEmail varchar(55),in branchType int(5))
    | COMMENT 'string'*/
if (branchId is not null) then

update tbl_unit_details set firmCode = branchCode,unitName = branchName where unitId = branchId;


insert into tbl_unit_details (firmCode,unitName,address,district,pincode,landline,startedDate,unitLat,unitLon,status,description,userId,unitImg,branchEmailid,unittype) values (branchCode,branchName,address,district,pincode,landline,startDate,lat,lon,branchStatus,branchDesc,userId,imgUrl,branchEmail,branchType);
select last_insert_id();

end if;



Important notes

Setting default value of a column to CURRENT_TIMESTAMP while creating a database allows to update current date time in that field automatically

sample query
create table consumerfed (itsection varchar(32),createdDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP);



March 25, 2017

Loading and Unloading spreadsheet template for Triveni Godowns


Created a loading and unloading template for Triveni Godown no 2 for godown incharge (+biju k). The apps was developed on march 2017. The application is deployed in consumerfed kozhikode regional office google drive. The same report can be viewed in regional office. The backup of application will be created 9th of month during midnight. The backup can be viewed by I T admin (+bithesh soubhagya) at regional office kozhikode. A pdf attached mail will be send weekly.

The particular has two options in the combo box " load and unload " and " advance payment ", choose the particular enter the advance paid, then enter the loading charge per day, balance will be automatically displayed on the top.

You can contact me at 8281808029


link to sheet

Please provide your comments/feedbacks

Thanks to +Biju k


March 07, 2017

sample web application using ajax jquery - spring mvc

sample web application

JSP page

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link href="css/branches.css" rel="stylesheet" type="text/css" media="screen" />
<script src="http://code.jquery.com/jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript" src="js/branches.js" ></script>
<div id="branchListDiv">

css page(css/branches.css)

    border: 1px solid black;

js page(js/branches.js)

$(document).ready(function() {
var branches = ["Regional Office", "tsm nadakkavu", "zonal office"];
                        $('#branchListDiv').html('<div class="branch"><table width="400" height="80"><tr><th>TRIVENI SUPER MARKET NADAPURAM</th></tr><tr><td>NEAR BUSSTAND</td><td>400sqft</td><td rowspan="3">img</td></tr><tr><td>NADAPURAM POST</td><td>3000rent</td></tr><tr><td>PH:2345698</td></tr></table></div>');


March 04, 2017

February 15, 2017

Online attendance tracking system consumerfed administration

Online attendance tracking system consumerfed

Issues and solutions

Step 0 : Download the bat file here

Step 1 : check your internet connection

Step 2 : set Mozilla as your default browser

Open Mozilla firefox browser >> Go to tools (or Type Alt+T) >> click on Option >> click on Make default button

How it works - video

Consumerfed I T Section, Kozhikode


February 11, 2017

Find the top 3 words in a sentence

Java Programs

 * @author +Java Script
 * Top 3 words from sentence

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class SentenceWord {
public static void main(String[] args) {
Map<String,Integer> map = new HashMap();
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();

for(String s: str.split("\\s")){
       int a =  map.get(s);
       a = a+1;


February 09, 2017


Used to control a request
They are invoked by the controller (Filter Dispatcher)
Interceptors perform action such as
o Logging
o validation
o file upload
o double submit guard etc.

 How Interceptor works?
1. Request is generated by user and sent to Servlet container.
2. Servlet container invokes FilterDispatcher filter which in turn determines appropriate action.
3. One by one Intercetors are applied before calling the Action. Interceptors perform tasks such as Logging, Validation, File Upload, Double-submit guard etc.
4. Action is executed and the Result is generated by Action.
5. The output of Action is rendered in the view (JSP, Velocity, etc) and the result is returned to the user.

Explanation: -

1. Request is generated by user and sent to Servlet container http://localhost:8080/StrutsValidationEx/ - web.xml
2. Servlet container invokes FilterDispatcher filter which in turn determines appropriate action. Invoking filter Dispatcher (web.xml)









Determining Appropriate action (struts.xml) Welcome.jsp


Configuring interceptor in struts: -

<interceptor name="mylogging"



<interceptor-stack name="loggingStack">

<interceptor-ref name="mylogging" />

<interceptor-ref name="defaultStack" />



This code has to be added after <result-types > tag in <package>


Note that creation of interceptor stack with the name “logginstack” is to

make sure that struts2 calls all the default interceptors as well while calling

the custom interceptor mylogging.

This is important because the validation logic will not works in our

application if we ignore default stack of interceptor.


February 03, 2017

Online sales application for consumerfed kozhikode region

Online sales application for accounts section


The application was initially developed for supporting the inventory system developed by I T section (head office). The project was assigned by Regional Manger through the I T, which then modified and new features are added as a requirement by pco kozhikode. The features like cash-credit report . subsidy monitoring, monthly sales, tranfer-in transfer out monitoring were include as per the requirement of accounts manager +deepa. The project was developed on may 2015 to validate sales details for Bee bee software developed by IT section consumerfed. The data were missing, double in the software at that time, so to analyse and solve the data issue the spreadsheet was very much helped them.

     This spreadsheet helps to validate the data in the software, help to fix the bugs related with data (includes sales, expense, r&d etc). Proper internet connection is mandatory to run the sheet. The spreadsheet will change daily so as to help the triveni units to enter their last day sales details, also the system automatically compute the reports needed for accounts section and email accounts manager. The branches under kozhikode region can also enter their monthly sales transaction / account details in the sheet.  The application automatically keep a backup in consfedkozhikode@gmail.com google drive folder named " Backup ". link to spreadsheet is given in the page.

To edit the template of the sales sheet use the controller sheet, I T admin can edit this. contact number : 8281808029

controller sheet

In addition to source code , my soul is also present in this project.  I worked so sincerely and honestly on this project. Each steps were challenging as there was an unsupported behavior from the regional manager as well as regional I T section once the project was deployed. They made me to stop running the project by defaming my work.

The below are the features in the apps.

Daily sales html report

Daily sales html report
sample download here

Daily sales pdf report

sample download here

Day wise subsidy report

Day wise subsidy report with packing charges details

For sending fund flow statement

Day wise cash credit sales

Monthly wages details

Wages details email
sample download here

Monthly expense, purchase, sales report

monthly expense, sales, purchase

sample download here

Messaging to unit

sending message to unit through google spreadsheet

Fast moving consumer goods to accounts section

FMCG report consumerfed

Online sales monitoring application

Online sales monitoring application

Daily sales google script code

Google script code for spreadsheet

Automatic Backup of spreadsheet

The application will automatically create a back up of the whole spreadsheet with monthly data entered by the user in office google drive folder named backup

Messaging to triveni units through spreadsheet

any one who can login to office mail can access the spreadsheet script editor, there by helps them to send message to triveni units, a pop up will show on the screen as shown in the screen shot

Admin can lock & unlock the spreadheet

Locking and unlocking the sheet prevents the user for entering the data, the task was initially assigned by Regional Manager

link to daily sales spreadsheet

Thanks to +deepajayaprakash payyanakkal


January 26, 2017

Budget preparation (monthly) consumerfed kozhikode region- accounts section

Budget Prepartion Kozhikode region conusmerfed

Thanks to +deepa (Account Manager) for her supports

contact me at 9539604142


January 03, 2017

Java Games with source code

Add caption


January 02, 2017

Traffic Light in java

Traffic Light program in java

Traffic light in java source code

package test;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class TrafficLight extends JFrame implements ActionListener {
    JButton buttonRed, buttonYellow, buttonGreen;

      Signal green = new Signal(Color.green);
      Signal yellow = new Signal(Color.yellow);
      Signal red = new Signal(Color.red);

    public TrafficLight(){
        super("Java Traffic Light Program");
        getContentPane().setLayout(new GridLayout(2, 1));
        buttonRed = new JButton("Red");
        buttonYellow = new JButton("Yellow");
        buttonGreen = new JButton("Green");


        JPanel trafficPanel = new JPanel(new GridLayout(3,1));
        JPanel lightPanel = new JPanel(new FlowLayout());


    public static void main(String[] args){
        TrafficLight trafficLight = new TrafficLight();      
    public void actionPerformed(ActionEvent e){      
        if (e.getSource() == buttonRed){
        } else if (e.getSource() == buttonYellow){
        } else if (e.getSource() == buttonGreen){
class Signal extends JPanel{

    Color on;
    int radius = 40;
    int border = 10;
    boolean change;

    Signal(Color color){
        on = color;
        change = true;

    public void turnOn(boolean a){
        change = a;

    public Dimension getPreferredSize(){
        int size = (radius+border)*2;
        return new Dimension( size, size );

    public void paintComponent(Graphics graphics){
        graphics.setColor( Color.black );

        if (change){
            graphics.setColor( on );
        } else {
            graphics.setColor( on.darker().darker().darker() );
        graphics.fillOval( border,border,2*radius,2*radius );


January 01, 2017

Temple Management System


Billing and accounting software

Source code


Facebook comments