WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext());
UserContainer container = (UserContainer) context.getBean("userContainer");
IStructureManager structureManager = (IStructureManager) context.getBean("structureRawManager");
IBookingManager bookingManager = (IBookingManager) context.getBean("bookingRawManager");
try {
IUser user = container.getUser();
Structure structure = (Structure) structureManager.get(user.getStructureId());
if (structure != null){
Collection<Room> rooms = bookingManager.getVacantRoomsForStructure(structure, CalendarUtils.GetToday(), CalendarUtils.GetToday());
pageContext.getOut().print(rooms.size());
}