I used Stripes with JSP and "action bean first" approach, (all JSPs were under 
/WEB-INF/jsp/)

I used action beans like:

@UrlBinding("some-url.xhtml")
public class HomeActionBean extends BaseActionBean {
    
    @DefaultHandler
    @DontValidate
    public Resolution display() {
        return new ForwardResolution("/WEB-INF/jsp/home.jsp");  
    }
}

Now I want to use FreeMaker with "action bean first" approach
I created "/WEB-INF/templates/home.tfl" placed freemaker jar to classpath

and changed code to:

@UrlBinding("some-url.xhtml")
public class HomeActionBean extends BaseActionBean {
    
    @DefaultHandler
    @DontValidate
    public Resolution display() {
        return new ForwardResolution("/WEB-INF/templates/home.tfl");  
    }
}

Now every time I open "some-url.xhtml" in the browser I always get
"HTTP Status 404 - /DemoSite/WEB-INF/templates/home.tfl"


Please, note, I don't want to make free maker templates accessible directly, 
for example, by /DemoSite/home.tfl 
like will be when I use free maker filter:

 <servlet>
        <servlet-name>Freemarker</servlet-name>
        <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
        <init-param>
            <param-name>TemplatePath</param-name>
            <param-value>/WEB-INF/templates/</param-value>
        </init-param>
        <init-param>
            <param-name>template_update_delay</param-name>
            <param-value>0</param-value> <!-- 0 is for dev only! Use higher 
value otherwise. -->
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    
    <servlet-mapping>
        <servlet-name>Freemarker</servlet-name>
        <url-pattern>*.ftl</url-pattern>
    </servlet-mapping>


Any suggestion, how can switch from jsp to freemaker templates "action bean 
first" approach and restrict any access to templates except through action 
beans?




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to