locked
Wildcard in HTTPHandler registration RRS feed

  • Question

  • User-2108369543 posted

    Hi all,

    I've created a handler with the name ForbiddenResourceHandler in mvc application.i want to handle url pattern like  the following

    https://localhost/XXX/Content/

    https://localhost/XXX/Content/RibbonBar

    https://localhost/XXX/Content/RibbonBar/FirstLook

    so the registration part is as bellow

        <handlers>
    	<add verb="*" path="*/Content/" resourceType="Directory"  name="ForbiddenResourceHandler"  type="nVision.Handlers.ForbiddenResourceHandler,nVision.Core"  preCondition="integratedMode"/>
    	<add verb="*" path="*/Content/*/" resourceType="Directory"  name="ForbiddenResourceHandler1"  type="nVision.Handlers.ForbiddenResourceHandler,nVision.Core"  preCondition="integratedMode"/>
    	<add verb="*" path="*/Content/*/*/" resourceType="Directory"  name="ForbiddenResourceHandler3"  type="nVision.Handlers.ForbiddenResourceHandler,nVision.Core"  preCondition="integratedMode" />
        </handlers>

    but i want to register it in single place instead of 3.i don't want to handle file,i just want to handle directory.

    How can i write the path to match the three url pattern?Please let me know. 

    Monday, November 3, 2014 8:34 AM

All replies

  • User103933760 posted

    Hi,

    Doesn't the third one meet the requirement?

    <add verb="*" path="*/Content/*/*/" resourceType="Directory"  name="ForbiddenResourceHandler3"  type="nVision.Handlers.ForbiddenResourceHandler,nVision.Core"  preCondition="integratedMode" />

    Tuesday, November 4, 2014 1:52 AM
  • User-2108369543 posted

    No

    Thursday, November 6, 2014 12:21 AM