• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using EL in normal java class.

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
im new to EL.Can anyone tell me how to use EL in normal java page(non jsp/jsf pages).My requirement is like this...we have a class A and it has a property b..i want the value of b and for that i want to use EL expression..

thanks and regards
arun
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Arun Thulaseedharan:
hi all,
im new to EL.Can anyone tell me how to use EL in normal java page(non jsp/jsf pages).My requirement is like this...we have a class A and it has a property b..i want the value of b and for that i want to use EL expression..



First of all Is this normal class a Servlet???
Second you said b is a property..This means it is a field in that class.
If yes then why do you want to use EL for that???
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JSP expression language is implemented as part of the JSP container; it's not (normally) available in Java code. Now, it's possible that, with sufficient knowledge, you could use the JSP container's EL code from normal Java code, but I doubt it; it's almost certainly not written to support that use case.
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, your best bet would be to look into the java.beans.Intorspector API and reflection. By properly understanding the two you could emulate the simplicity of EL using method calls.
 
Arun Thulaseedharan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot guys...actually i used JEXL for the same...guess that will the job for me...

thanks and regards
arun
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic