what different between InternalResourceViewResolver vs UrlBasedViewResolver

前端 未结 3 1192
小蘑菇
小蘑菇 2021-01-31 18:32

I just started using Spring. I came across a lot tutorials. I saw more examples using InternalResourceViewResolver than UrlBasedViewResolver. I looked

3条回答
  •  我在风中等你
    2021-01-31 19:06

    InternalResourceViewResolver is a convenient subclass of UrlBasedViewResolver.

    The JavaDoc describes some added properties in InternalResourceViewResolver that might be useful in some situations:

    Convenient subclass of UrlBasedViewResolver that supports InternalResourceView (i.e. Servlets and JSPs) and subclasses such as JstlView.

    AlwaysInclude: Controls whether either a forward or include is done.

    ExposeContextBeansAsAttributes: Allows all beans in context to be available as request attributes, which means they can be referenced from the EL in JSP.

    ExposedContextBeanNames: If non-null, specifies the list of beans that will be exposed, as opposed to all of them.

    Source from spring forum : Spring Q&A forum

提交回复
热议问题