Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using EL in normal java class.

 
Arun Thulaseedharan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • 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
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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???
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic