Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-12546

Permit matching slashes in @RequestMapping @PathVariables

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 4.1.3
    • Fix Version/s: None
    • Component/s: Web
    • Labels:
      None

      Description

      There's been a longstanding desire for some mechanism to match path variables including slash characters in @RequestMapping templates. The existing workarounds all seem to boil down to grabbing the HTTP request object and manually re-parsing the path.

      In my own specific case, I have a hierarchy of parameterized static content that essentially dispatches to views based on the path but needs to set up some model attributes first. This seems to be a common use case and currently requires multiple-mapping hacks.

      It would be very helpful to have a mechanism to explicitly specify that a path variable should match internal slash characters, perhaps as an extension of the var:regex syntax (can't include braces there).

        Attachments

          Activity

            People

            Assignee:
            rstoya05-aop Rossen Stoyanchev
            Reporter:
            w_c_smith Christopher Smith
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 31 weeks, 3 days ago