0

I'm looking to turn off try blocks for a specific JSP page (though turning it off globally would be OK as well). 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. Does anybody know how I can set this JSP parameters for a Spring MVC application? 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>
2
  • Spring doesn't do anything magical with JSPs. Why can't you keep using noTryBlocks like you already do? Have you tried it? Commented Apr 4, 2010 at 17:42
  • Forgot to mention, the deploy environment is glassfish. I don't have a weblogic.xml. I don't know where to put noTryBlocks in the first place. It seems to be a JSP parameters, so my thought was that the spring config for JSP's might have a way to set the parameter. Commented Apr 4, 2010 at 17:50

1 Answer 1

2

noTryBlocks is a Weblogic-specific feature (that's why it's in weblogic.xml). In fact, a web search suggests it was removed in Weblogic 9+.

From what I can tell, the only useful purpose of this is to slightly reduce the size of the compiled 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).

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I was trying to include a large file in a JSP per stackoverflow.com/questions/2349818/… . Found a way to do it via a streaming file servlet instead, making the JSP include tag (and noTryBlocks) unneeded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.