Path Variables In Spring Framework

Spring Framework offers to handle URI method parameters by using @PathVariable annotation

@Controller
@RequestMapping("admin")
public class PathVarController {

@RequestMapping("/welcome/{springPathVariable}/{page}")
public ModelAndView pathVariableTest(@PathVariable("page") String name, @PathVariable("springPathVariable") String pathVariable ) {

ModelAndView mav = new ModelAndView("pathVariable");
mav.addObject("message", " "+ name+" Your PathVariable is : "+pathVariable);
return mav;
}
}

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{