Hi Ron,
The pre-execution mechanism is mostly used for pages that renders a page on GET
requests, typically a form, and returns something else completely on POST
requests, such as a pdf/xls etc based on the submitted form. Or a redirect,
thats also typical.
The same functionality can be achieved with your approach, the form would just
post to URL that targets your servlet. But it can be very convenient to have
the logic for both GET and POST in the same controller.
Unless you need the form i don't think its worthwhile to rewrite it using
Blossom. In fact I have often recommended using your exact approach.
The real value of Blossom is in templating.
This is how to configure handler mappings for pre-execution:
<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>
Taken from
http://documentation.magnolia-cms.com/modules/blossom.html#Configuration
// Tobias
On Jan 22, 2013, at 10:53 AM, Ron de Ridder (via Magnolia Forums)
<[email protected]> wrote:
> Hi guys,
>
> I am using the servlets filter to hook in some Spring MVC controllers. These
> controllers are providing data and basically return JSON responses. The
> controller basically puts data in a JSONObject and returns a String
> representation of that JSONObject.
>
> I am now trying to convert this way of working to Blossom. What I want is a
> controller mapped to a specific URL that returns a response without using any
> templating. The documentation states that rendering entire pages can be done
> via pre-execution. To make pre-execution work the documentation states that
> "BlossomHandlerMapping delegate to your HandlerMapping". Does anybody have an
> example of how I should do this ? Or is my former approach via the servlets
> filter better ?
>
> Thanks,
>
> Ron
>
> --
> Context is everything:
> http://forum.magnolia-cms.com/forum/thread.html?threadId=276e1968-1651-4c1e-9294-5f02c3a68140
>
>
> ----------------------------------------------------------------
> 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]>
> ----------------------------------------------------------------
----------------------------------------------------------------
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]>
----------------------------------------------------------------