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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:25:36+00:00 2026-06-09T06:25:36+00:00

So let pick a UIComponent like HtmlSelectOneRadio (Please view source here: http://grepcode.com/file/repo1.maven.org/maven2/com.sun.faces/jsf-api/2.1.7/javax/faces/component/html/HtmlSelectOneRadio.java#HtmlSelectOneRadio ) So

  • 0

So let pick a UIComponent like HtmlSelectOneRadio(Please view source here: http://grepcode.com/file/repo1.maven.org/maven2/com.sun.faces/jsf-api/2.1.7/javax/faces/component/html/HtmlSelectOneRadio.java#HtmlSelectOneRadio)

So some of the setters will call method handleAttribute(...), and some does not, for example

public void setDir(java.lang.String dir) {
    getStateHelper().put(PropertyKeys.dir, dir);
    handleAttribute("dir", dir);
}

public void setDisabled(boolean disabled) {
    getStateHelper().put(PropertyKeys.disabled, disabled);
}

and it is very UNCLEAR to me what handleAttribute is doing, can a JSF guru please explain to me what this method try accomplish and why somes attribute call this method while other does not? Thank you so much

  • 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-09T06:25:38+00:00Added an answer on June 9, 2026 at 6:25 am

    It’s related to Mojarra-internal rendering optimizations, wherein only the attributes which are been set by the internal handleAttribute() method are been rendered as so-called “pass-thru” attributes instead of that every single attribute of the component will be checked if it has been set or not, which may end up to be more expensive if there are relatively a lot of attributes. A “pass-thru” attribute is a component attribute which can just be outright rendered without any specific pre/postprocessing.

    Peek around in Mojarra’s RenderKitUtils class, starting at the renderPassThruAttributes() method:

    316         if (canBeOptimized(component, behaviors)) {
    317             //noinspection unchecked
    318             List<String> setAttributes = (List<String>)
    319               component.getAttributes().get(ATTRIBUTES_THAT_ARE_SET_KEY);
    320             if (setAttributes != null) {
    321                 renderPassThruAttributesOptimized(context,
    322                                                   writer,
    323                                                   component,
    324                                                   attributes,
    325                                                   setAttributes,
    326                                                   behaviors);
    327             }
    328         } else {
    329 
    330             // this block should only be hit by custom components leveraging
    331             // the RI's rendering code, or in cases where we have behaviors
    332             // attached to multiple events.  We make no assumptions and loop
    333             // through
    334             renderPassThruAttributesUnoptimized(context,
    335                                                 writer,
    336                                                 component,
    337                                                 attributes,
    338                                                 behaviors);
    339         }
    

    The canBeOptimized() returns true if the component is one of the standard JSF components (actually, if the component’s package name starts with javax.faces.component.) and if there is no more than 1 behavior in the behaviors array.

    The renderPassThruAttributesOptimized() will only render the attributes which are specified in setAttributes argument.

    The renderPassThruAttributesUnoptimized() will loop through every single attribute in the attributes map and check for every single attribute if the associated value is not null/empty and then render it.


    As to why some attributes are not been set by handleAttribute(), that’s because they require some more specific pre/postprocessing and are already explicitly been rendered by the renderer specific to the component, so they don’t need to be rendered as a “pass-thru” attribute.


    You don’t need to worry about this when writing custom components. You can always introduce your own optimizations similar to this, but it isn’t recommend to rely on Mojarra-specific internal optimizations as they may not work at all when you’re using MyFaces, for example.

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

Sidebar

Related Questions

http://i.minus.com/i3xuoWZkpfxHn.png I don't see anything that would let me pick files from my computer...
Is there any way to let user pick color from screen ? Like the
Let us pick the following Win API call as an example: BOOL MessageBeep(UINT uType);
Let's have an example like below: package xliiv.sandbox; import android.app.Activity; import android.os.Bundle; import android.util.Log;
Let me try to explain by example. Say website is hosted at example.com (NOT
in my project, I let users pick pictures using the FileReference class. I then
I'm using a DatePicker to let someone pick a certain week. The html is
In Vista, I have been using an IFileSaveDialog to let users pick a save-as
It's feel like I'm stuck, my friends. Can somebody explain me pick equations from
I want a simple way to let my user pick there clothing size before

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.