Good day,
I am in the same use-case as original poster, am getting the same spring error,
and per Vinny's response, [b]would like to know what configuration(s) are
lacking[/b]. Below, find @RequestMapping method and blossom-servlet. Thanks
in advance for your help.
@Template(...)
@Controller
public class FooComponent {
@RequestMapping("/fooPath")
public ModelAndView render(@ModelAttribute("model") ModelMap model,
Node fooNode)
{
// try-catch block omitted for brevity
model.addAttribute("valueFromDialog",
fooNode.getProperty("valueFromDialog").getString());
return new ModelAndView("components/fooScript.ftl", model);
}
}
[b]blossom-servlet.xml[/b]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<mvc:annotation-driven />
<context:annotation-config/>
<context:component-scan base-package="com.excentus.magnolia.portal.base"
use-default-filters="false">
<context:include-filter type="annotation"
expression="info.magnolia.module.blossom.annotation.Template"/>
<context:include-filter type="annotation"
expression="info.magnolia.module.blossom.annotation.Area"/>
<context:include-filter type="annotation"
expression="info.magnolia.module.blossom.annotation.DialogFactory"/>
<context:include-filter type="annotation"
expression="info.magnolia.module.blossom.annotation.VirtualURIMapper"/>
</context:component-scan>
<!-- US XXXX v1 annotation scan -->
<context:component-scan base-package="com.my.company"
use-default-filters="true" />
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="customArgumentResolver">
<bean class="info.magnolia.module.blossom.web.BlossomWebArgumentResolver"
/>
</property>
</bean>
<bean class="info.magnolia.module.blossom.preexecution.BlossomHandlerMapping">
<property name="targetHandlerMappings">
<list>
<bean
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="useDefaultSuffixPattern" value="false" />
</bean>
<bean
class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />
</list>
</property>
</bean>
<bean
class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
<bean class="info.magnolia.module.blossom.view.UuidRedirectViewResolver">
<property name="order" value="1" />
</bean>
<!-- JSP - renders all views that end with .jsp -->
<bean class="info.magnolia.module.blossom.view.TemplateViewResolver">
<property name="order" value="2"/>
<property name="prefix" value="/templates/${artifactId}/"/>
<property name="viewNames" value="*.jsp"/>
<property name="viewRenderer">
<bean class="info.magnolia.module.blossom.view.JspTemplateViewRenderer">
<property name="contextAttributes">
<map>
<entry key="stkfn">
<bean
class="info.magnolia.rendering.renderer.ContextAttributeConfiguration">
<property name="name" value="stkfn"/>
<property name="componentClass"
value="info.magnolia.module.templatingkit.functions.STKTemplatingFunctions"/>
</bean>
</entry>
<!-- If you need the DAM templating functions in JSPs uncomment
this block to have them set as an attribute named 'damfn'.
<entry key="damfn">
<bean
class="info.magnolia.rendering.renderer.ContextAttributeConfiguration">
<property name="name" value="damfn"/>
<property name="componentClass"
value="info.magnolia.dam.asset.functions.DamTemplatingFunctions"/>
</bean>
</entry>
-->
</map>
</property>
</bean>
</property>
</bean>
<!-- Freemarker - renders all views that end with .ftl -->
<bean class="info.magnolia.module.blossom.view.TemplateViewResolver">
<property name="order" value="3"/>
<property name="prefix" value="/templates/${artifactId}/"/>
<property name="viewNames" value="*.ftl"/>
<property name="viewRenderer">
<bean
class="info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer">
<property name="contextAttributes">
<map>
<entry key="cms">
<bean
class="info.magnolia.rendering.renderer.ContextAttributeConfiguration">
<property name="name" value="cms"/>
<property name="componentClass"
value="info.magnolia.templating.freemarker.Directives"/>
</bean>
</entry>
<entry key="cmsfn">
<bean
class="info.magnolia.rendering.renderer.ContextAttributeConfiguration">
<property name="name" value="cmsfn"/>
<property name="componentClass"
value="info.magnolia.templating.functions.TemplatingFunctions"/>
</bean>
</entry>
<entry key="stkfn">
<bean
class="info.magnolia.rendering.renderer.ContextAttributeConfiguration">
<property name="name" value="stkfn"/>
<property name="componentClass"
value="info.magnolia.module.templatingkit.functions.STKTemplatingFunctions"/>
</bean>
</entry>
<!-- If you need the DAM templating functions in Freemarker
uncomment this block to have them set as an attribute named 'damfn'.
<entry key="damfn">
<bean
class="info.magnolia.rendering.renderer.ContextAttributeConfiguration">
<property name="name" value="damfn"/>
<property name="componentClass"
value="info.magnolia.dam.asset.functions.DamTemplatingFunctions"/>
</bean>
</entry>
-->
</map>
</property>
</bean>
</property>
</bean>
</beans>
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=a0450c46-0526-4ce2-a2ab-efe3b98297f8
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------