Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Expression language  RSS feed

 
Thamarai kannan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i have doubt in getting real path using implicit object

Above one is for getting method type.similarly i don't know how to do for real path
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't. By design, the EL cannot call general methods.

Why would you be doing this in a JSP? It's not really a suitable operation in a view.
 
Thamarai kannan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi bear...actually i come across about Expression language in Head first.In that they mentioned as if by using page context we can access methods of request,session,application and page classes.
Ex:${pagecontext.request.method}

my doubt is how to access getRealPath() method in El ?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2902
196
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thamarai,

You can't because getRealPath() needs a String as a parameter.

Regards,
Frits
 
Hongli Li
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you mean something like context root path ${pageContext.request.contextPath}?
why you want to the realpath, are you trying to load some resources? then it will be your servlets' job
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thamarai kannan wrote:Hi bear...actually i come across about Expression language in Head first.In that they mentioned as if by using page context we can access methods of request,session,application and page classes.

I am sure that you are mis-reading that. You can access the properties of those elements, but not general methods.
 
Thamarai kannan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Friends i am clear now but i have two doubts

first, what are all the implicit properties can be accessed by using request like ${pageContext.request.method},${pageContext.request.host}.......etc

second, is it possible to assign the El values to java variables
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Look it up in the javadoc. Anything that's a bean property "getter" can be accessed.

2) No. Once again: properties only!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!