ninjaframework / ninja

Ninja is a full stack web framework for Java. Rock solid, fast and super productive.
http://www.ninjaframework.org
Apache License 2.0
1.91k stars 518 forks source link

Inconsistency in message formatting #95

Closed pthum closed 11 years ago

pthum commented 11 years ago

There's an inconsistency in the message formatting. The "FlashCookie" uses the String.format-method to format a message with arguments. Thereby you have to use e.g. "%s" as placeholder in your messages. The "Messages" uses instead the MessageFormat.format (from java.text), which expects placeholders from kind "{0}". To my mind, the MessageFormat-version is a very nice one, because you don't have to care about the types of the arguments. On the other hand, the String.format seems to be a bit faster ( http://jevopisdeveloperblog.blogspot.de/2009/09/stringformat-vs-messageformatformat-vs.html ).

raphaelbauer commented 11 years ago

Hi,

can you please have a look at: https://github.com/reyez/ninja/pull/96

It fixes the issue and also improves some other things.

Let me know what you think :)

Thanks!

Raphael