This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
...but alas <c:set> does not accept expressions for the var attribute (which I knew but forgot).
So, before I go writing my own custom tag to do this, I'd like to know: Does something already exist in JSTL or the standard custom tag library <jsp:xxx> to do this? Or perhaps in struts 1.x (which I am using in this project)?
I got the same problem. Believe it. There is a reason for this.
Let's say you got a tag-file:
I.E. The purpose is to set some value taken from EL or some HTML and make it visible to the caller. Using taglibs is not good enough, because handling the HTML in java code sucks. Normally, the HTML and the inserted value should be unentangled, but if the inserted value is a bunch of complicated HTML, it simply can't be well unentangled.
But, it is very simple to write a SimpleTag to simulate a <c:set> where the var is rtexprvalue. So, in my opinion, <c:set> should have the var attribute with rtexprvalue="true", so nobody would need to reinvent the well in this point.