dandelion / dandelion-datatables

Dandelion component for DataTables
http://dandelion.github.io/components/datatables/
Other
110 stars 49 forks source link

Async servlet support #214

Closed tduchateau closed 10 years ago

tduchateau commented 10 years ago

Issue by tdlage from Tuesday Oct 08, 2013 at 16:17 GMT


DatatablesFilter is annotated with @WebFilter, mapping /*, but has no asyncSupported.

So, using datatables, i can´t use async servlets.

tduchateau commented 10 years ago

Comment by tduchateau from Monday Oct 14, 2013 at 17:45 GMT

Hi,

A solution will be provided in the 0.10.0 (i.e. when the connection will be done with Dandelion Core):

Thanks for your feedback!

Regards, Thibault

tduchateau commented 10 years ago

Comment by fkurth from Tuesday Oct 15, 2013 at 10:45 GMT

a workaround is: Add metadata-complete="true" to the head of web.xml. This disables processing of the @Webfilter etc. annotations. Then re-add the servlet and filter manually in web.xml with

<!--  Dandelion datatables -->
<servlet>
    <servlet-name>datatablesController</servlet-name>
    <servlet-class>com.github.dandelion.datatables.core.web.servlet.DatatablesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
</servlet>

<servlet-mapping>
    <servlet-name>datatablesController</servlet-name>
    <url-pattern>/datatablesController/*</url-pattern>
</servlet-mapping>

<filter>
    <filter-name>DataTablesFilter</filter-name>
    <filter-class>com.github.dandelion.datatables.core.web.filter.DatatablesFilter</filter-class>
    <async-supported>true</async-supported>
</filter>

<filter-mapping>
   <filter-name>DataTablesFilter</filter-name>
   <url-pattern>/*</url-pattern>
</filter-mapping>
tduchateau commented 10 years ago

Comment by tduchateau from Tuesday Oct 15, 2013 at 20:55 GMT

Great workaround @fkurth! I didn't know the metadata-complete="true" trick :-)

After speaking with @rlespinasse, we've come to the conclusion that we'll drop the default support of Servlet 3.0 API in the next release of Dandelion-Datatables (and Dandelion, core). It's a big change that is comming in the 0.10.0, as well as other major changes. We'll explain that a bit later.

To get back to the subject, you will need some XML back to declare servlets (and filters). Support for Servlet 3.0 (and corresponding 3.0-related features) will be provided in a dedicated module.

Regards, Thibault

tduchateau commented 10 years ago

Comment by tduchateau from Saturday Nov 30, 2013 at 22:21 GMT

Closing this one, since it's now possible to use a custom servlet (supporting async) by extending the com.github.dandelion.core.asset.web.AssetServlet (available in Dandelion 0.3.0). If you don't want to use annotations, the workaround mentioned by @fkurth works like a charm.