This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

I know I cannot use ${bs.getPayableAmount()}. The payable amount is computed on the fly depending on the data. I also know that a workaround would be to create a class variable that stores the payable amount determined before the view is called. However having hundreds of functions having the same nature, it is a bit cumbersome to do it that way. Is there another work around it. I am also avoiding the use of scriplets and hope to use all-JSTL

Comment

getPayableAmount() does not return a class variable but is a method that uses several of the class variables to determine the payable amount

bs.getXXX only works for getters and setters of class vars having the same name not the other methods as far as I know. I also tried it hoping that it might work... however, as expected, it did not work.

Comment

There's no need for a getter method to have a corresponding field, it could be a 'virtual' field computed from several values.
If your method signature is getXxx then you should be able to use ${bs.xxx}.

In your case, you have to use ${bs.payableAmount} and not ${bs.getPayableAmount} (the 'get' disappear).

Comment

You should study the Expression Language, especially how and when it can be used. You should also take a look at the JavaBeans specification. In short, EL lets you navigate an object properties by calling standard JavaBeans getter methods. Per specification, getters have no attributes, so you can't do that. If you need to pass a parameter back to the server it means you need to somehow change or refresh the model so you should go the standard mvc way (i.e. trigger navigation by calling a controller -> populate the model from the business layer -> reload the page).