Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 616297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:18:43+00:00 2026-05-13T18:18:43+00:00

Is it possible to overload an EL method in JSF 1.1 using Facelets as

  • 0

Is it possible to overload an EL method in JSF 1.1 using Facelets as your view handler? If so, how?

For example, I have this code defining my EL methods (which are defined in namespace k):

public static String doStuff( String s ) {
    return doStuff( null, s );
}

public static String doStuff( Map<String,String> m, String s ) {
    ...
    return something;
}

When I try to call #{k:doStuff("hey!")} from my Facelets page, I get this error:

Function 'k:doStuff' specifies 2 params, but 1 was declared
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:18:43+00:00Added an answer on May 13, 2026 at 6:18 pm

    It looks like the problem was with how it was declared. For example, I was using this to declare my methods:

    public class KTagLib extends AbstractTagLibrary {
        public static final String NAMESPACE = "http://mysite.blah/tags";
        public static final KTagLib INSTANCE = new KTagLib();
    
        public KTagLib() {
            super(NAMESPACE);
            try{
                try {
                    Method[] methods = KTags.class.getMethods();
    
                    for (int i = 0; i < methods.length; i++) {
                        if (Modifier.isStatic(methods[i].getModifiers())) {
                            this.addFunction(methods[i].getName(), methods[i]);
                        }
                    }
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }            
            }
        }
    

    and using the following configuration:

    <?xml version="1.0"?>
    <!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
    <facelet-taglib>
        <library-class>mypackage.KTagLib</library-class>
    </facelet-taglib>
    

    However, the this.addFunction() is essentially calling put() on a java.util.Map object so that duplicate methods can’t be added since the keys are the same between doStuff.

    To solve this problem, I’ll have to explicitly declare the methods in the *.taglib.xml unless anyone knows of a way to dynamically solve the problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to overload a method on default parameters? For example, if I
I have been trying to overload my index method. Here are my index methods:
This may have been answered before. I see many dynamic method overload resolution questions,
Possible Duplicate: Overload resolution and virtual methods If i call this , why object
Is it possible to overload Extension Methods? I did something like this public static
Is it possible to overload [] (__getitem__) Python operator and chain methods using the
Possible Duplicate: Overload ++ operator Say i have a class in which i overloads
Is it possible to overload a method in web service?
Is it possible to overload the array/dict access operators in VB.net? For example, you
is possible to overload a main method? If yes from which method the jvm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.