• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with EL  RSS feed

 
sammeta Phanikumar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I have kept an Object(FormFile) in the request scope and I want to access this objects methods in a JSP using EL, but I could not.

Please tell me using EL I can access only Bean properties(get****) or methods of objects also.

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EL is specifically designed to only access bean properties. You cannot cal methods.
 
Paul Yule
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally speaking you do not want to do methods on your jsp anyway. You may want to think about calling the methods before it is sent to the jsp and limit your jsp to simply displaying.

If the method that you are trying to access is for displaying purposes only you may want to look into creating a custom tag to do the operation, and for many common display features these tags are done for you in other tag libraries.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul speaks wisely. Modern JSPs should be used for view purposes only. Any data processing or other activities not related to building a view should be handled in the page controller prior to the JSP being invoked.

The EL was purposefully designed to lead us down that path.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!