be a well encapsulated person, don't expose your privates, unless you public void getWife()!
David Newton wrote:What makes you think ${widget} refers to a string? It'll refer to whatever is in the list: widgets. Is that what you meant?
be a well encapsulated person, don't expose your privates, unless you public void getWife()!
Stephen Davies wrote:I'm not sure where you got 'widgets' from, so no that's not what I was referring to.
However I read somewhere that the array var (in my case "widget") refers to an instance of String
Because neither the list, nor each item in the list, is a widget.
be a well encapsulated person, don't expose your privates, unless you public void getWife()!
Stephen Davies wrote:... I was of the understanding that it was a reference to the current VisitNewWidgetTestTemplateClass object in the List, as that is what the List is declared to hold, and that is what I believe I had put in there. However if this is not the case, then herein lies my issue, indeed what does the "widget" variable actually refer to then?
be a well encapsulated person, don't expose your privates, unless you public void getWife()!
be a well encapsulated person, don't expose your privates, unless you public void getWife()!
An expression language makes it possible to easily access application data stored in JavaBeans components.
Bear Bibeault wrote:In the same way that making sure to put gas in your car is a "rule". No one's going to force you to do it, but if you don't, things just don't work out too well.
be a well encapsulated person, don't expose your privates, unless you public void getWife()!
Stephen Davies wrote:Now it is my understanding that in usual Java practice, naming getters and setters 'get_widget', 'get widget', GetWidget', or even '$getWidget' whilst unbecoming, and poor code, nonetheless will still operate upon any 'explicit' call to them later in the program,
in fact, I have come across many examples (not to pass any judgement upon them) where a public reference variable is indeed accessed not by a getter and setter but by the dot operator (as in #Object.#member#).
Now please, do not misunderstand me, this is what my understanding has been in regards to non web-based Java development, (though personally I favor the JB convention, as do I like clean simple and well commented code). My question therefore still stands, (though perhaps I'm a little nearer to an understanding). As you kind moderators Bear, David and Paul seem to be exemplifying, is that in regards to my posted predicament, within the JSP / JSLT Taglib domain, the functionality I'm trying to implement in my code, is that which requires javaBean 'rules'. So as doing so, I am lead to the new comprehension that the calls to the JSON via ${#var.#member} are in fact, an implicit call to a getter based on JB convention in my class in question?
Again, these things are new to me as I work predominantly in javaScript to Java where we have company written JSON producing java-API. We certainly use JSP as part of an MVC architecture, but most of the Taglib JSON production is simple Maps and Array iteration, less on object traversal. In this case, I was asked to change the implementation away from my posted example, but it is certainly refreshing to learn something new here and once more I thank you gentlemen.
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|