这是控制器的外观,以便Hybris使用它:
@Controller("CustomCMSImageComponentController")@RequestMapping(value = ControllerConstants.CustomCMSImageComponent )// now the controller is mapped to "/view/CustomCMSImageComponentController"public class CustomCMSImageComponentController extends AbstractCMSComponentController<CustomCMSImageComponentModel> { @Override protected void fillModel(final HttpServletRequest request, final Model model, final CustomCMSImageComponentModelcomponent) { //here the spring Model(model method parameter) should be filled with what is needed to dynamically render in JSP }}
Spring使用@Controller批注来实例化CustomCMSImageComponentController并将该实例(bean)保留在Spring应用程序上下文中。
呈现CustomCMSImageComponent时,Hybris在spring应用程序上下文中搜索名称为“
CustomCMSImageComponentController”的bean之后,以查找与该组件关联的Controller,如果找不到任何内容,将使用DefaultCMSComponentController。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)