简体   繁体   English

Spring MVC JSP参数

[英]Spring MVC JSP Parameters

I'm looking to turn off try blocks for a specific JSP page (though turning it off globally would be OK as well). 我希望关闭特定JSP页面的try块(尽管也可以在全局范围内将其关闭)。 From what I've gathered, it looks something like this: 从我收集到的信息来看,它看起来像这样:

<jsp-param>
<param-name>noTryBlocks</param-name>
<param-value>true</param-value>
</jsp-param>

However, everywhere I see that sample it's for a weblogic.xml file. 但是,到处都可以看到该示例是针对weblogic.xml文件的。 Does anybody know how I can set this JSP parameters for a Spring MVC application? 有人知道如何为Spring MVC应用程序设置此JSP参数吗? web.xml? web.xml中? Perhaps somewhere near here?: 也许在这里附近?

  <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
    <property name="prefix" value="/WEB-INF/jsp/"/>
    <property name="suffix" value=".jsp"/>
  </bean>

noTryBlocks is a Weblogic-specific feature (that's why it's in weblogic.xml ). noTryBlocks是Weblogic的特定功能(这就是为什么它在weblogic.xml )。 In fact, a web search suggests it was removed in Weblogic 9+. 实际上,网络搜索表明已在Weblogic 9+中将其删除。

From what I can tell, the only useful purpose of this is to slightly reduce the size of the compiled JSP. 据我所知,这样做的唯一有用目的是稍微减小已编译JSP的大小。 This sounds like a nasty hack to begin with; 听起来像是一个讨厌的骇客。 if this is the case, and you would be better served by making your JSPs smaller to start with (using includes or tag files). 如果是这种情况,最好通过减小JSP的开头(使用包含文件或标记文件)来为您提供更好的服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM