Hi,
How can I access the WroModel from a spring bean ? I was using the following code and it is erroring out saying "No context associated with CURRENT request cycle!";
ServletContextAttributeHelper helper = new ServletContextAttributeHelper(m_context);
WroManagerFactory wroManagerFactory = helper.getManagerFactory();
WroManager wroManager = wroManagerFactory.create(); // This is the line where error is occuring !
WroModelFactory wroModelFactory = wroManager.getModelFactory();
WroModel wroModel = wroModelFactory.create();
Collection<Group> groups = wroModel.getGroups();
for (Group group : groups) {
List<Resource> resources = group.getResources();
for (Resource resource : resources) {
m_map.put(resource.getUri(), group.getName());
}
}
Thank you.