Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

calling method from jsp  RSS feed

 
anna popova
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys!!can anybody help me with my problem? i want to call my User class's get function in jsp page
like this <c:out value="${user.getFirstname() }"/>..it doesn't work..how can i do this?
 
Vijitha Kumara
Saloon Keeper
Posts: 3997
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!
...it doesn't work...

It's hard to assume what's wrong with this. You need to tell what the error (if any) and how you do this etc...(Please read -> TellTheDetails). You may refer the EL functions How To for more details on this in general.
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uhm, you can't do that. You don't want an EL function, you want just a getter. When we talk about getters in EL, we just write the (encapsulated) property name. you should use the following:

 
anna popova
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh thanks guys!!it works.
I have getFirstname() method , and it invokes when i write <c:out value="${user.firstname}" /> ...once again,thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You really need to read up on the Expression Language rather than just guessing what will work and what will not.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!