Closed GoogleCodeExporter closed 9 years ago
I'm not sure. We do not want to encourage poor designs.
What exactly is the reason they aren't final?
Original comment by balusc
on 15 May 2013 at 1:56
I can think of 3 different use cases for such a change:
1) Some of the constants are initialized at servlet context listener. (to some
value read from DB at that time.) but after then it is used just like any other
constant.
2) final constants are replaced when compiled, but sometimes you need to change
a constant and expect referencing classes/JARs see the update without a full
compile.
3) I may just need to reference a static field in a class. not necessarily a
constant. maybe a logger or smt like that?
(ps: i already altered my copy of the source and did this change. But I feel
like this may be useful to others as well, that is why I opened this issue)
Original comment by fma...@gmail.com
on 15 May 2013 at 6:23
1) such a listener gives you already the opportunity to set a Map<K,V> of those
values in application scope by event.getServletContext().setAttribute("data",
data)
2) makes maybe sense, I'd however have used a mutable reference
3) wouldn't recommend this, it tight-couples controller with view
Original comment by balusc
on 26 Jun 2013 at 2:41
Closing off as "WontFix". Introducing this would enable potential abuse and
tight-couple model/controller too much with view (like as Scriptlets ever
somewhat unintentionally did). There are better ways.
Original comment by balusc
on 9 Aug 2013 at 3:41
Original issue reported on code.google.com by
fma...@gmail.com
on 12 May 2013 at 1:15