API for expression language evaluation
Hello, is there an API for expression language evaluation? E.g. it should be able to evaluate the following attribute values: ${bean.property} Should be evaluated to the property value of the bean. ${empty collection} should be evaluated to true/false foobar should become the string foobar. Does the JSTL provide such an API? Thank You, Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: API for expression language evaluation
On Wednesday 20 August 2003 06:19 am, Johann Uhrmann wrote: is there an API for expression language evaluation? Yes, there is. But it's part of Jakarta Standard, not JSTL itself. ${bean.property} Should be evaluated to the property value of the bean. Take a look on this article, it explain how to achieve that: http://www.onjava.com/pub/a/onjava/2002/10/30/jstl3.html Does the JSTL provide such an API? Unfortunately, the JSTL 1.0 specification doesn't provide that API. But that's not really a problem because: - most - if not all - of current JSTL 1.0 implementations are based on Jakarta Standard - which provides such API - JSTL 1.1 (and I guess the next versions too) requires JSP 2.0, which takes care of EL handling Felipe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: API for expression language evaluation
Yes, there is. For an example on how to add the EL to your own tags you can look at the struts-el tag libraries which are included as part of the Struts core. I use the org.apache.strutsel.taglib.utils.EvalHelper class to evaluate EL expressions. This ties my application to Struts, but I am comfortable with that. If you are not, it should be simple to tie your classes only to the JSTL by only referencing the org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager class, which the EvalHelper depends on. Matt Johann Uhrmann wrote: Hello, is there an API for expression language evaluation? E.g. it should be able to evaluate the following attribute values: ${bean.property} Should be evaluated to the property value of the bean. ${empty collection} should be evaluated to true/false foobar should become the string foobar. Does the JSTL provide such an API? Thank You, Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Matthew Sgarlata Senior Consultant Booz Allen Hamilton Inc. Work: 703-377-0871 Fax: 703-902-3608 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]