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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:30:56+00:00 2026-05-31T19:30:56+00:00

Here is my code: <h:inputText size=22 value=#{bean.searchString} id=drugName> <a4j:support actionListener=#{bean.searchMedication} ajaxSingle=true reRender=contentListGrid event=onkeyup id=searchAjax

  • 0

Here is my code:

<h:inputText size="22" 
    value="#{bean.searchString}"
    id="drugName">

    <a4j:support
        actionListener="#{bean.searchMedication}"
        ajaxSingle="true" reRender="contentListGrid"
        event="onkeyup" id="searchAjax" 
        requestDelay="200" 
        rendered="#{bean.searchString.length() > 0}">
    </a4j:support>
</h:inputText> 

I would like to prevent the a4j:support call whenever the input field is not filled out. I tried it by determining the input value length in the rendered attribute. However, it results in the following exception:

org.apache.jasper.JasperException: /pages/medication/MedicationList.jsp(147,9) The function length must be used with a prefix when a default namespace is not specified
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
    at org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1478)

What does this message mean?

The function length must be used with a prefix when a default namespace is not specified

Can’t we invoke a method in EL?

  • 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-31T19:30:58+00:00Added an answer on May 31, 2026 at 7:30 pm

    As to the concrete exception, invoking non-property methods (i.e. non-getter/setter methods) is only supported since EL 2.2 which is part of Servlet 3.0 / JSP 2.2. You seem to be using old JSF 1.x and thus also old Servlet 2.5 / JSP 2.1. Basically you end up with an EL syntax error.

    Actually, you don’t need EL 2.2 for this. Just use empty keyword instead.

    rendered="#{not empty bean.searchString}"
    

    However this approach won’t work as well. The rendered attribute will be examined in the server side when the HTML code is to be generated and sent to the browser, not during the client side events as you seem to expect (rightclick page in browser, View Source, do you see any JSF code?). You need to use JavaScript to check the input value length in the onkeyup of the field or onsubmit of the Ajax call and return false accordingly.

    <h:inputText ... onkeyup="return (!!value)">
    

    or (not guaranteed that this works, I don’t know off top of head what markup it generates)

    <h:inputText ...>
        <a4j:support ... onsubmit="return (!!value)" />
    </h:inputText>
    

    The first ! converts it to inversed boolean and the second ! re-inverses it. This way you end up with a fullworthy boolean return outcome depending on the presence of any value. If it’s false, then the remaining onkeyup functions (such as you’ve specified with <a4j:support>) will be blocked.

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

Sidebar

Related Questions

I have the follwoing code from Richfaces 3.3 <h:inputText id=transamount value=#{myBean.amount}> <a4j:support event=onkeyup ajaxSingle=true
Here is JSF code: <h:inputText binding=#{bean.input} /> And here is a part of backing
I have a very simple JSF form: <h:form id=simpleSearch> <h:inputText id=surname value=#{myBean.surname} required=true />
here is my code: groups: { phone: phone1-phone2-phone3 digits: true }, errorPlacement: function(error, element)
I'm using inputText to get input from a user <h:inputText id=firstName value=#{beanManager.currentUser.firstName } required=true
i am trying to include a java code into the value of the inputText
Ok the error is showing up somewhere in this here code if($error==false) { $query
Here is code from MSDN . I don't understand why the work isn't just
Here a code to demonstrate an annoying problem: class A { public: A(): m_b(1),
enter code here I have a table on SQL server 2005 with bigint primary

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.