java的calss中,在public static void main(String[] args) { }方法中调用非static的方法:在main方法中创建该calss的对象,用对象调用非static方法 public class Test{ public void testaction(){ //方法体 } public static void main(String[] args) { Test test = new Test(); test.testaction(); } }
之前对于前端框架接触较少,第一次接触thymeleaf,虽说看起来并不复杂但我还是花费了好一会儿才弄懂. 话不多少下面就简单说一下我在项目中的应用. 首先是java代码 controller层 将需要在前端展示的信息放入model中: @RequestMapping("getAll") public String getAll(Model model){ List<ScheduleJob> list = scheduleJobService.getAllJob(); mod