Issue Details (XML | Word | Printable)

Key: PLAY_ROUTER_MODULE-1
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: nicolas_leroux
Reporter: ygpark80
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
play-router-module

war deployment won't resolve the url correctly

Created: 11/Apr/11 08:36 AM   Updated: 11/Apr/11 08:36 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Java Source File RouterPlugin.java (8 kB) 11/Apr/11 08:36 AM - ygpark80
2. File RouterPlugin.java.bak (8 kB) 11/Apr/11 08:36 AM - ygpark80


Tags:


 Description  « Hide

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


There are no comments yet on this issue.