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

  • Using SimpleUrlMappingHandler

    Hi,
    I am experimenting with M2 release. Trying to convert my example to the new M2 release. I like the new namespace support, but I encounter some issues due to my custom extensions. One of them is something I am not sure of that I am doing the right thing. I want to accomplish the following:

    <flex:message-broker disable-default-mapping="true">
    <flex:secured />
    </flex:message-broker>

    <bean class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <value>
    /config.properties=configPropertyController
    /*=_messageBroker
    </value>
    </property>
    </bean>

    It would be nice if I could do something like this:
    <flex:message-broker>
    <flex:mapping pattern="/config.properties=configPropertyController"/>
    <flex:mapping pattern="/*"/> <!-- will pick the default _messageBroker -->
    </flex:message-broker>

    It would be great if someone has a tip to improve this.

    thanks Jettro

  • #2
    Given that the namespace tags are domain-specific, I'd rather not overload the mapping element to allow mappings to other handler objects.

    I would recommend that you just break the mapping of your controller(s) into it's own separate HandlerMapping and take advantage of the Ordered interface. For example:

    Code:
    <flex:message-broker>
        <flex:secured />
    </flex:message-broker>
    
    <bean class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
        <property name="order" value="0"/>
        <property name="mappings">
            <value>
                /config.properties=configPropertyController
            </value>
        </property>
    </bean>

    Comment


    • #3
      Thank you Jeremy, that is indeed better.

      Comment

      Working...
      X