Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-1
-
Component/s: nanowar
-
Labels:None
-
Number of attachments :
Description
I made a patch to retrieve Dispatcher instance from application level PicoContainer (if not found, fall back to default ChainingDispatcher).
Here is a sample configuration for using FreeMarker as view:
[[nanocontainer.groovy]]
if (assemblyScope instanceof javax.servlet.ServletContext) {
pico = new org.picocontainer.defaults.DefaultPicoContainer(parent)
pico.registerComponentInstance(new org.nanocontainer.nanoweb.ChainingDispatcher(".ftl"))
return pico
} else if (assemblyScope instanceof javax.servlet.http.HttpSession) {
return new org.picocontainer.defaults.DefaultPicoContainer(parent)
} else if (assemblyScope instanceof javax.servlet.ServletRequest) {
return new org.picocontainer.defaults.DefaultPicoContainer(parent)
}
[[web.xml]]
<servlet>
<servlet-name>FreeMarker</servlet-name>
<servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
<init-param>
<param-name>TemplatePath</param-name>
<param-value>/</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>FreeMarker</servlet-name>
<url-pattern>*.ftl</url-pattern>
</servlet-mapping>
Activity
Field | Original Value | New Value |
---|---|---|
Attachment | configurable_dispatcher.patch [ 11976 ] |
Status | Open [ 1 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] | |
Fix Version/s | 1.0-beta-1 [ 10147 ] | |
Assignee | Aslak Hellesoy [ rinkrank ] |
Applied. Thanks!