Accessing Spring beans from a Tiles view (JSP)

前端 未结 3 1347
逝去的感伤
逝去的感伤 2020-12-03 01:33

In Spring MVC I can access my beans in JSP using JstlView\'s exposedContextBeanNames (or exposeContextBeansAsAttributes). For example, then, in my JSP I can write (${propert

3条回答
  •  难免孤独
    2020-12-03 02:13

    As of Spring 3.0 there is now a TilesViewResolver.

    Convenience subclass of UrlBasedViewResolver that supports TilesView (i.e. Tiles definitions) and custom subclasses of it.

    The view class for all views generated by this resolver can be specified via the "viewClass" property. See UrlBasedViewResolver's javadoc for details.

    Note: When chaining ViewResolvers, a TilesViewResolver will check for the existence of the specified template resources and only return a non-null View object if the template was actually found.

    Since: 3.0 Author: Juergen Hoeller

提交回复
热议问题