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 7834441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:09:24+00:00 2026-06-02T13:09:24+00:00

I am trying to call method using custom EL function with perameter of jsfbean.

  • 0

I am trying to call method using custom EL function with perameter of jsfbean.

<c:set var="test1" value="${cx:methodName('para')}" scope="session"/>
        <h:outputText value="#{test1}"/>

i made following id TLD and putted it into WEB-INF

  <?xml version="1.0" encoding="UTF-8" ?>
    <taglib 
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
        version="2.1">

        <tlib-version>1.0</tlib-version>
        <short-name>Custom_Functions</short-name>
        <uri>http://example.com/functions</uri>

        <function>
            <name>methodName</name>
            <function-class>funcionclass(Jsfbean)</function-class>
            <function-signature>java.lang.String methodName(java.lang.String)</function-signature>
        </function>
    </taglib>

i also configure in web.xml

<jsp-config> 
        <taglib> 
               <taglib-uri>http://example.com/functions</taglib-uri> 
               <taglib-location>/WEB-INF/functions.tld</taglib-location> 
        </taglib> 
</jsp-config>

and still it is getting Function not found error.

following is method code

public static String methodName(String s1) throws Exception
    {
        return "Kshitij";
    }

can any body help.

  • 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-06-02T13:09:25+00:00Added an answer on June 2, 2026 at 1:09 pm

    You’ve created a JSP EL function while you’re using Facelets. This is not going to work. Also, your <function-class> declaration is incorrect. It should specify the full qualified class name (FQN). E.g. com.example.FunctionClass.

    Rename the taglib file to /WEB-INF/functions.taglib.xml with the following updated content:

    <?xml version="1.0" encoding="UTF-8"?>
    <facelet-taglib 
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
        version="2.0">
        <namespace>http://example.com/functions</namespace>
    
        <function>
            <function-name>methodName</function-name>
            <function-class>com.example.FunctionClass</function-class>
            <function-signature>java.lang.String methodName(java.lang.String)</function-signature>
        </function>
    </facelet-taglib>
    

    Then you need to register it in web.xml as follows (don’t forget to remove the old JSP taglib registration!):

    <context-param>
        <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
        <param-value>/WEB-INF/functions.taglib.xml</param-value>
    </context-param>
    

    Finally declare it in your view by the following XML namespace

    xmlns:cx="http://example.com/functions"
    

    Unrelated to the concrete problem, there’s an alternative approach, probably much easier: install JBoss EL. This way you will be able to invoke methods on beans like as possible in the new EL 2.2.

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

Sidebar

Related Questions

I'm trying to call a Page Method using a jQuery 'attached' event function, in
I'm trying to iterate over an enum, and call a method using each of
I'm trying to execute custom JS code from a Firefox extension using: function executeJS(document,
I'm having a problem while trying to call a custom Model method from my
I'm trying to call a custom HtmlHelper's extension method from a partial view <%:
I'm trying to call method from .jar But when I want to declare array
I am trying to call a method that requires some parameters based on previous
I am currently trying to call a method in the aspx.cs inside of my
I'm trying to call a Sort method that expects a parameter of type IComparer<object>
I am trying to call the .ajax() method when a button with id=go is

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.