Skip to content

Support default URI prefix for web service @RequestMapping #4994

@lewisdavidcole

Description

@lewisdavidcole

There doesn't seem to be anyway, short of explicitly prefixing each individual @RequestMapping with a default URI like @RequestMapping(path="**/api**/controller1" at the top of the @RestController class, where **/api** is the default. I'm trying to have a clear separation in URL paths between normal application requests and web service requests, allowing me to provide additional security specific to web services.

I have an ongoing StackOverflow post, with no meaningful solution to-date and would like to suggest an enhancement to allow a default URI prefix to be supported somewhere in the Spring Boot application.properties configuration.

http://stackoverflow.com/questions/34801351/how-to-configure-a-default-restcontroller-uri-prefix-for-all-controllers

The result would be, using the example above, that my request mapping would be defined as:

@RequestMapping(path="controller1") 

The resulting URL would resolve to
> /<root_context>/api/controller1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions