TinyMCE Spellcheck Implmentation with Spring MVC

  17 Feb 2014

I recently added a Java implementation of TinyMCE Spellchecker plugin to a web application which utilitizes Spring MVC. I used Andrey’s guide to make this happen. His instructions worked great until Spring was thrown into the mix. Spring requires the use of ServletWrappingController which will take a standard java controller and provide it with Spring’s functionality. There were 2 key steps I needed to do in addition to what his guide suggests.

1) Ensure the URL being used by the plugin is passed to the dispatcher in web.xml. In this example we’re using *.json.



2) Since *.json is being forwarded to the dispatcher, now the dispatcher needs to tell Spring what URL to map the spellchecker controller to, and wrap it with the ServletWrappingController.

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="mappings">
            <prop key="/spellchecker/google-spellchecker.json">googleSpellChekerWrappingController</prop>

<bean id="googleSpellChekerWrappingController" class="org.springframework.web.servlet.mvc.ServletWrappingController">
    <property name="servletClass">
comments powered by Disqus