use of org.springframework.web.bind.annotation.GetMapping in project scoold by Erudika.
the class RevisionsController method get.
@GetMapping("/{postid}")
public String get(@PathVariable String postid, HttpServletRequest req, Model model) {
Post showPost = utils.getParaClient().read(postid);
if (showPost == null) {
return "redirect:" + questionslink;
}
Pager itemcount = utils.getPager("page", req);
List<Revision> revisionslist = showPost.getRevisions(itemcount);
// we need the first revision on the next page for diffing
List<Revision> nextPage = showPost.getRevisions(new Pager(itemcount.getPage() + 1, itemcount.getLimit()));
utils.fetchProfiles(revisionslist);
model.addAttribute("path", "revisions.vm");
model.addAttribute("title", utils.getLang(req).get("revisions.title"));
model.addAttribute("showPost", showPost);
model.addAttribute("itemcount", itemcount);
model.addAttribute("revisionslist", revisionslist);
model.addAttribute("lastOnPage", nextPage.isEmpty() ? null : nextPage.get(0));
return "base";
}
use of org.springframework.web.bind.annotation.GetMapping in project spring-boot by spring-projects.
the class WelcomeController method welcome.
@GetMapping("/")
public String welcome(Map<String, Object> model) {
model.put("time", new Date());
model.put("message", this.message);
return "welcome";
}
use of org.springframework.web.bind.annotation.GetMapping in project spring-boot by spring-projects.
the class WelcomeController method welcome.
@GetMapping("/")
public String welcome(Map<String, Object> model) {
model.put("time", new Date());
model.put("message", this.message);
return "welcome";
}
use of org.springframework.web.bind.annotation.GetMapping in project spring-boot by spring-projects.
the class IndexController method index.
@GetMapping("/")
@Transactional(readOnly = true)
public ModelAndView index() {
List<Note> notes = this.noteRepository.findAll();
ModelAndView modelAndView = new ModelAndView("index");
modelAndView.addObject("notes", notes);
return modelAndView;
}
use of org.springframework.web.bind.annotation.GetMapping in project cas by apereo.
the class SamlMetadataController method generateMetadataForIdp.
/**
* Displays the identity provider metadata.
* Checks to make sure metadata exists, and if not, generates it first.
*
* @param response servlet response
* @throws IOException the iO exception
*/
@GetMapping(path = SamlIdPConstants.ENDPOINT_IDP_METADATA)
public void generateMetadataForIdp(final HttpServletResponse response) throws IOException {
final File metadataFile = this.metadataAndCertificatesGenerationService.performGenerationSteps();
final String contents = FileUtils.readFileToString(metadataFile, StandardCharsets.UTF_8);
response.setContentType(CONTENT_TYPE);
response.setStatus(HttpServletResponse.SC_OK);
try (PrintWriter writer = response.getWriter()) {
LOGGER.debug("Producing metadata for the response");
writer.write(contents);
writer.flush();
}
}
Aggregations