提交用例
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.heibaiying.springboot;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SpringBootJspApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringBootJspApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.heibaiying.springboot.bean;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author : heibaiying
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Programmer {
|
||||
|
||||
private String name;
|
||||
|
||||
private int age;
|
||||
|
||||
private float salary;
|
||||
|
||||
private LocalDate birthday;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.heibaiying.springboot.controller;
|
||||
|
||||
import com.heibaiying.springboot.bean.Programmer;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author : heibaiying
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@RequestMapping("index")
|
||||
public class JspController {
|
||||
|
||||
@RequestMapping
|
||||
public String jsp(Model model){
|
||||
Programmer programmer = new Programmer("heibai", 21, 1298.31f, LocalDate.now());
|
||||
model.addAttribute("programmer",programmer);
|
||||
return "show";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user