Created
June 22, 2018 01:56
-
-
Save bigalnz/50155af322a6c94f08e54510e39f9f1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.... | |
<form action="#" th:action="@{/greeting}" method="post"> | |
..... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@org.springframework.stereotype.Controller | |
@EnableAutoConfiguration | |
public class Controller { | |
@Autowired | |
nz.org.needsassessment.PdfGeneratorUtil pdfGenaratorUtil; | |
@GetMapping ("/") | |
String home() { | |
return "static/assessment.html"; | |
} | |
@PostMapping("/greeting") | |
public String greetingSubmit() { | |
Map<String,String> data = new HashMap<String,String>(); | |
data.put("name","James"); | |
try { | |
pdfGenaratorUtil.createPdf("greeting",data); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
return "finished"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment