• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL function should be public and static!!

 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the following code appearing in a JSP file:

<h1>${refdata:topic(1)}</h1>

Which of the following statements are correct?

1. The class that has the function must implement Function interface.
2. The class used to satify this function must have a method with signature: void topic(int i).
3. The function invoked by this code must be static.
4. The function invoked by this code must be specified in the deployment descriptor.
5. This code is syntactically incorrect.

the correct answer is 3. I think its wrong. It should be public and static... not just static.

they assumed it being declared as public or what??

Please correct me

thanks
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Poonam Agarwal wrote:they assumed it being declared as public or what??


May be . That says it should be static, so that's correct right?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It must be static ? Yes.
It must also be public.
I think 3 is correct. You cannot say that it is not a correct statement.
 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you all
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic