标签:use log one 编程 variable pid aspect info method
@RequestMapping(path={"/","/index"}) url请求路径
@RequestBody 返回非模板,若要返回模板里的html或者php删除即可
@RequestMapping(path={"/profile/{groupId}/{userID}"}) url请求路径
@PathVariable("userID" ) int userID, 放在方法形参中 读取用户信息
@RequestParam("key" ) int key 放在方法形参中 读取请求参数
IOC 与 AOP
IOC
AOP 面向切面编程
@Aspect
@Component
public class LogAspect{
private static final Logger logger = LoggerFactory.getLogger(LogAspect.class)
@Before("execution(* com.nowcoder.controller.indexController.*(..))")
public void beforeMethod(){
logger.info();
}
@After("execution(* com.nowcoder.controller.indexController.*(..))")
public void beforeMethod(){
logger.info();
}
}
标签:use log one 编程 variable pid aspect info method
原文地址:https://www.cnblogs.com/ytnwu/p/11029013.html