код:
Код: Выделить всё
Student
Status Connection : ${connStatus == "Connected" ? "Connected" : "Disconnected"} ${connMessage}
Код: Выделить всё
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Apr 18 03:34:46 WIB 2024
There was an unexpected error (type=Internal Server Error, status=500).
org.apache.jsp.web_002dtpl.views.index_jsp
Код: Выделить всё
private String connStatus = "Disconnected";
private String connMessage = "";
@RequestMapping("/")
public String index(Model model) {
try {
Class.forName("org.postgresql.Driver");
Connection conn = DriverManager.getConnection(url, user, password);
connStatus = "Connected";
} catch (Exception e) {
// TODO Auto-generated catch block
connMessage = e.getMessage();
}
model.addAttribute("connStatus", connStatus);
model.addAttribute("connMessage", connMessage);
return "index";
}
Подробнее здесь: https://stackoverflow.com/questions/783 ... springboot
Мобильная версия