A critical part of using InternalResourceViewResolver seems to be that Spring needs to be involved in the code flow when the jsp page is being processed.
If you re accessing the jsp page directly or otherwise bypassing any Spring-based action (e.g. perhaps by internally forwarding to a jsp page due to login configuration in web.xml), then that won t work.
However, it is possible to configure your application so that certain beans are accesible to anything that can get to the ServletContext (aka applicationScope) through
the use of the ServletContextAttributeExporter class.
在你的春季组合中,增加:
<bean id="mybean" .../>
<bean class="org.springframework.web.context.support.ServletContextAttributeExporter">
<property name="attributes">
<map>
<entry key="attrname" value-ref="mybean"/>
</map>
</property>
</bean>
之后,在菲律宾统计局的网页上,你可以与下列人士接触:
${applicationScope.attrname}
或者如果你知道你没有“对象名称”这一更具体的范围,那就是:
${attrname}
很显然,这只胜数能够提及申请或会议范围大豆,但是如果你需要使用单一吨灯塔,那是不起作用的。