When using war deployment with router module, the deployed play project does not resolve the actions properly.
When a play project is packaged with war deployment and deployed to a servlet container with a context name, using
@Get("/a/b")
should map the action to "{contextName}/a/b" but it maps to "/a/b".
- To resolve this bug:
When creating a routing path in RouterPlugin.java, it uses 'annotation.value()' and the Play's deployed context name is not considered.
So what I did was I replaced
annotation.value()
with something like
String.format("%s%s", Play.ctxPath, annotation.value())
- Patch:
I'm not familiar with git I'll just provide my modified code.
RouterPlugin.java - modified
RouterPlugin.java.bak - original