Answer the question
In order to leave comments, you need to log in
How to me to implement transfer of Map'y through session?
I have a controller. This controller has (relatively speaking) two methods: scheduleByStationsAndDatePersist and confirmBooking .
Now more about these methods. scheduleByStationsAndDatePersist forms a Map using its business logic. This Map has the following structure:
Map<ScheduleDTO, List<Schedule>> map = graphService.filter(list); // Map'ка инициализируется
Mars: [
Schedule ( id: 71, 2018-10-18 12:00:00 → 2018-10-18 13:00:00, Toksovo → Kavgolovo, train: Mars ),
Schedule ( id: 72, 2018-10-18 13:05:00 → 2018-10-18 14:00:00, Kavgolovo → Oselki, train: Mars )
]
Aqua: [
Schedule ( id: 73, 2018-10-18 12:10:50 → 2018-10-18 13:10:10, Toksovo → Kavgolovo, train: Aqua ),
Schedule ( id: 74, 2018-10-18 13:25:00 → 2018-10-18 14:10:00, Kavgolovo → Oselki, train: Aqua )
]
Mars
and Aqua
is toString representation of the ScheduleDTO blank. The key here is this blank (I decided to display the name of the train just for clarity), and the value is a list of real Schedules from the database. @RequestMapping(value = "/viewTicketsTrainInfo")
public String confirmBooking(Model model) {
...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question