Allow other formats when binding parameters

Bug #458450 reported by Nicolas Leroux
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
play framework
Fix Committed
Wishlist
Nicolas Leroux
1.0
Won't Fix
Wishlist
Nicolas Leroux
1.1
Fix Committed
Wishlist
Nicolas Leroux

Bug Description

In case of a resource url, users can bind define binding on date.

/document/${documentDate} ie /document/01-12-2009/ (documentDate might be the Id)

However, currently we cannot specified the date format and we cannot retrieve the date format according to the locale:
the URL of any resources should not change depending of the locale.

http://groups.google.com/group/play-framework/browse_thread/thread/cb81fb4941a66e52

Add a new annotation that allows to specify the date format: @As("dd-MM-yyyy")

for example:

public static show(@As("dd-mm-yyyy") Date date) {
    ...
}

Note that the same kind of annotation could be used in another use case:

/mailboxes/{<.*>folderNames}/ -> /mailboxes/2009/june/

and then

public static show(@Separator("/") List<String> mailboxes) {
    ...
}

or

/books/{languages}/ -> /books/fr,ja,de/

public static show(@Separator(",") List<String> mailboxes) {
    ...
}

This is basically the same idea, and thus means that the mechanism must be flexible.

Changed in play:
status: New → In Progress
Changed in play:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.