Results 1 to 3 of 3

Thread: How do I get my freemarker templates to have access to the errors?

  1. #1
    Join Date
    May 2009
    Posts
    246

    Default How do I get my freemarker templates to have access to the errors?

    I'm having a problem getting the errors in my freemarker scripts. I'm sure I just have to expose them in some way. Do I use an interceptor, or is there a feature I just need to turn on? What is the best way to do it? Thanks!

  2. #2
    Join Date
    Sep 2007
    Posts
    23

    Default

    are you talking in ftl view?

    try
    <attempt>
    </attempt> to catch your ftl exception ...

  3. #3
    Join Date
    May 2009
    Posts
    246

    Default

    Oh, I should have been more specific. I meant form errors. I found out the solution by looking at other people's example code after lots of searching...

    Code:
        <bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
            <property name="cache" value="true"/>
            <property name="prefix" value=""/>
            <property name="suffix" value=".ftl"/>
            <property name="exposeSpringMacroHelpers" value="true"/>
        </bean>
    They need to put this in the manual, as this is pretty much required stuff.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •