Announcement Announcement Module
Collapse
No announcement yet.
help with request mapping with regex in pathVariables needed Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • help with request mapping with regex in pathVariables needed

    Hi,

    I'm trying to find a way of mapping requests but I can't figure it out:
    Here is what I need:

    /prefix/typ1/somepath --> methodA("typ1", "somepath")
    /prefix/typ1/ --> methodA("typ1", "")
    /prefix/typ1/somepath/withSubPath --> methodA("typ1", "somepath/withSubPath")
    /prefix/typ1/somepath/withSubPath/anotherPath --> methodA("typ1", "somepath/withSubPath/anotherPath")

    /prefix/typ1/somepath/withSubPath/a.file --> methodB("typ1", "somepath/withSubPath/a", ".file")
    /prefix/typ1/somepath/a.file --> methodB("typ1", "somepath/a", ".file")
    /prefix/typ1/a.file --> methodB("typ1", "a", ".file")

    and I tried something like:

    Code:
    @RequestMapping(/prefix/{pathVar1}/{pathVar2:[\\w\\/]*})
    public String methodA(String pathVar1, String pathVar2) {
    ...
    }
    @RequestMapping(/prefix/{pathVar1}/{pathVar2:[\\w\\/]+}{extention:\\.[a-z]+})
    public String methodA(String pathVar1, String pathVar2, String extention) {
    ...
    }
    I got only 404 response codes

    Can anybody help?

  • #2
    anybody out there with a hint?? I really need to get this done ...

    Comment

    Working...
    X