*I got a calendar function in a HTML page of Jquery using a <script> anotaction.
I need to fill this Calendar using a Json structure that I already know hoy to generate usin springboot but I get confused because i only know how to send the json or the view in the "return" (thymeleaf) tag.*
****this is HTML- JQUERY CALENDAR FUNCTION
//It recibes this information****
This is a calendar full usin json information
----------------------
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
The next one is an example of two events that I can see cause are in the function already defined like so.
>>>>
events: [
{
title: 'Barber',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit..',
start: '2020-05-05',
end: '2020-05-05',
className: 'fc-bg-default',
icon: "circle"
},
{
title: 'Flight Paris',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
start: '2020-08-08T14:00:00',
end: '2020-08-08T20:00:00',
className: 'fc-bg-deepskyblue',
icon: "cog",
allDay: false
},
],
These are two examples of sending the information from the controller to de view
**This are JAVA SPRING BOOT CONTROLLERS`**
//Controll method to send a model of Event Object. In this case it does not work cause htlm recibes an object and not a JSON
>>>>>
--------------------
@GetMapping(value = "inicio", produces = MediaType.APPLICATION_JSON_VALUE)
public String inicio(Model model) {
Event event = new Event("Reunion","Reunión plan D","2021-03-21T09:30:00",
"2021-03-21 11:45:00","prueba", "glass", false,"1");
model.addAttribute("evento",event);
return "index";
}
-------------------
//In this case i send a list in Json but it is not beeing readed by the view cause I never mention the view
private List<Event> events;
>>>>
//@PostConstruct public void enviarEventos(){
events = new ArrayList<>();
events.add(new Event("Reunion","Reunión plan D","2021-03-21T09:30:00",
"2021-03-21 11:45:00","prueba", "glass", false,"1"));
events.add(new Event("Reunion","Reunión plan D","2021-03-21T09:30:00",
"2021-03-21 11:45:00","prueba", "glass", false,"1"));
}
//Busqueda de Eventos recorriendo una lista
@GetMapping(value = "inicio", produces = MediaType.APPLICATION_JSON_VALUE)
public List<Event> inicio() {
return events;
}
What i need is to be able and send to html the Json object an fill the camps in calendar