How do I exclude a link from requiring a controller and ftl file?

24 views
Skip to first unread message

Gianna Giavelli

unread,
Jan 14, 2015, 6:27:52 PM1/14/15
to acti...@googlegroups.com

I'm doing a simple link to a pdf file. It even launches a new window. But activeweb jumps in and wants a method in my controller for the PDF file and then wants a matching ftl. 

I'm sure it's in the doc somewhere, but how do I exclude stuff from the framework. aka I need to break convention.
Message has been deleted

Gianna Giavelli

unread,
Jan 14, 2015, 6:38:11 PM1/14/15
to acti...@googlegroups.com
found it. its in web.xml in the exclusions list..


As a result it is easy to set it up in a file web.xml. Below is a configuration file from a real commercial project. Usually these files do not get any more complicated:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>activeweb</display-name>
    <filter>
        <filter-name>dispatcher</filter-name>
        <filter-class>org.javalite.activeweb.RequestDispatcher</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>exclusions</param-name>
            <param-value>css,images,js,html,ico,png</param-value>
        </init-param>
        <init-param>
            <param-name>root_controller</param-name>
            <param-value>home</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>dispatcher</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

Igor Polevoy

unread,
Jan 14, 2015, 6:44:26 PM1/14/15
to acti...@googlegroups.com
correct, additionally this will give you binary download instructions: http://javalite.io/controllers#downloading-of-files

tx 
Reply all
Reply to author
Forward
0 new messages