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

  • Home
  • SEARCH
  • 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 832009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:17:41+00:00 2026-05-15T04:17:41+00:00

I was wondering how I could create component-scoped beans, or so-to-say, local variables inside

  • 0

I was wondering how I could create “component-scoped” beans, or so-to-say, “local variables inside a composite component” that are private to the instance of the composite component, and live as long as that instance lives.

Below are more details, explained with an example:

Suppose there is a “calculator” component – something that allows users to type in a mathematical expression, and evaluates its value. Optionally, it also plots the associated function.

I can make a composite component that has:

  • a text box for accepting the math expression
  • two buttons called “Evaluate”, and “Plot”
  • another nested component that plots the function

It is evidently a self-contained piece of function; so that somebody who wants to use it may just say <math:expressionEvaluator />

But obviously, the implementation would need a java object – something that evaluates the expression, something that computes the plot points, etc. – and I imagine it can be a bean – scoped just for this instance of this component, not a view-scoped or request-scoped bean that is shared across all instances of the component.

How do I create such a bean? Is that even possible with composite components?

  • 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-15T04:17:42+00:00Added an answer on May 15, 2026 at 4:17 am

    There is no “per-component instance” scope. But you can still achieve your desired effect.

    Use a ViewScoped bean to do the evaluating and plotting – these functions are “stateless” and so are fed by your input.

    Your input would be backed by a user supplied bean – in the same way a text box or calendar widget needs an input box bound to a user supplied bean. This holds the data that your “stateless” viewscoped bean acts on.

    If you really wanted to keep everything contained in the component, I guess you could back the input with a ViewScoped bean that contains a map keyed by the input id. Not sure if that would work though.

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

Sidebar

Related Questions

I am wondering how I could create a dropshadow on a container that would
I am wondering how I could create a custom data type to use within
I was wondering if i could create an android application which procures the mobile's
I'm wondering how I could create a gradient wuth multiple stops and a direction
I was wondering if i could create a object of some class if i
I was wondering whether you could create your own .NET Attribute classes for PowerShell
I was wondering if I could create a routing map with one more higher
I was wondering if I could create an app which supports opening .html-pages. For
I could create two ajax requests, but I'm wondering if there is an easy
For some time now I've been wondering whether I could create a custom template

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.