Example 1:http://spring.io/guides/gs/rest-service/
String padding , such as %s
Private Static Final String template = "Hello,%s!" = "WWJ"; String.Format (template, name);
Self-increment type
Private Final New Atomiclong (); Counter.incrementandget ();
@RequestMapping @RequestParam
@RequestMapping ("/greeting") Public Greeting greeting (@RequestParam (value= "name", defaultvalue= " World ") {...}
Example 2:http://spring.io/guides/gs/scheduling-tasks/
Output time by format
Private Static Final New SimpleDateFormat ("HH:mm:ss");d Ateformat.format (new Date ());
@Scheduled timed Operation
@Scheduled (fixedrate =); // put it in front of a small function ?
@EnableScheduling // Add in front of program main entrance
Example 3:http://spring.io/guides/gs/device-detection/
@ResponseBody Switch to HTTP return
Public @ResponseBody String detectdevice (device device) { ... return "Hello" + DeviceType + "browser!" ;}
Device type judgment
Import org.springframework.mobile.device.device;device device;device.isnormal ();d evice.ismobile ();d Evice.istablet ();
Spring Boot Learning notes