Results 1 to 3 of 3

Thread: Using SimpleUrlMappingHandler

  1. #1
    Join Date
    Aug 2004
    Location
    The Netherlands
    Posts
    160

    Default 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
    Jettro Coenradie
    http://www.gridshore.nl

  2. #2
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    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>
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  3. #3
    Join Date
    Aug 2004
    Location
    The Netherlands
    Posts
    160

    Default

    Thank you Jeremy, that is indeed better.
    Jettro Coenradie
    http://www.gridshore.nl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •