Shell Script Tips

Shell Script, delete last 30 day's records from system.

#!/bin/bash
# Delete log files older than 30 days in this script.

find /var/log/tomcat7/localServer/logs/ -mtime +30 -type f -delete
echo "-----------------------------------------------------"
echo "$(date)"
echo "Deleted files older than 30 days in this location :: /var/log/tomcat7/ "


Custom Tag In Java

Custom Tag Library use to make own tag in jsp by extending TagSupport class, build xml with (.tld) extension file, which specify the result would you want to use.
Java Server Page (JSP) contain standard tag library @taglib for including (.tld) file.

public class CustomTagTest extends TagSupport {

public CustomTagTest() { }

@Override
public int doStartTag() throws JspException {
JspWriter out = pageContext.getOut();//returns the instance of JspWriter
   try{

Design Pattern Tutorial


Design Pattern are best practices how to solve common know problems. This article will give an overview of best practices in object-oriented programming and has pointers to some design-pattern tutorials.
Design patterns are proven solutions approaches to specific problems. A design pattern is not a framework and is not directly deployed via code.

Design Pattern have two main usages: