Announcement Announcement Module
Collapse
No announcement yet.
Output html page Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Output html page

    I'm trying to add a SimpleUrlHandlerMapping to my spring - blazeDS configuration to output a dynamically generated html page for a specific url.

    This is the current mapping for the spring DispatcherServlet:

    Code:
    <servlet>
        <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/config/web-application-config.xml                     
            </param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>
    
      <servlet-mapping>
        <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
        <url-pattern>/messagebroker/*</url-pattern>
      </servlet-mapping>

    I've tried to add a SimpleUrlHandlerMapping as a bean in the applicationContext.xml like this:

    Code:
      <bean id="publicUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
          <value>
              /messagebroker/index.html=indexController
          </value>
        </property>
      </bean>
    But when a request comes in at /messageBroker/index.html, it's handled like this:

    Code:
    DEBUG SimpleUrlHandlerMapping - Mapping [/index.html] to handler 'flex.messaging.MessageBroker@9292ece'
    So it's being handled by the flex MessageBroker, but what i'm trying to do is to map this request directly to my Controller, without any blazeds interaction.


    Anyone knows if this is possible somehow ?

  • #2
    Set the order property on your additional handler mapping so that it comes first in the chain.

    Comment


    • #3
      Btw, it's worth noting that in M2 you cannot control the order of the handler mapping that is installed by the namespace config tags, but this has been fixed in trunk and will be available in the impending RC1.

      Either way, for your case, setting the order of your custom mapping to a lower value such as 0 should get the job done.

      Comment


      • #4
        thanks for the hint, my controller seems to kick in now, but i get a ServletException:

        Code:
        No adapter for handler [net.dubture.controller.IndexController@60d7c9e6]: Does your handler implement a supported interface like Controller?
        It implements org.springframework.web.servlet.mvc.Controller. I've tested the controller before with a non spring-flex servlet and it worked fine.

        Comment


        • #5
          have you try this : http://forum.springsource.org/showthread.php?t=66278

          This fix the problem for me.

          Comment

          Working...
          X