Is there a way to configure managed properties on a superclass?

Hi,
I'm looking for a way to set a managed property on a superclass of a managed bean rather than setting it on every single managed bean extending that superclass.
Here's a simple scenario. I've got an application scoped managed bean called "configuration" which holds (what a surprise) some configuration. It is configured like this:
     <managed-bean>
          <managed-bean-name>configuration</managed-bean-name>
          <managed-bean-class>myapp.model.ConfigurationModel</managed-bean-class>
          <managed-bean-scope>application</managed-bean-scope>
     </managed-bean>
Now I want to use this bean from within some other request scoped managed beans (Let's say bean1 .. beanN). Of course I could inject the configuration bean into every single bean like this:
     <managed-bean>
          <managed-bean-name>bean1</managed-bean-name>
          <managed-bean-class>myapp.model.Bean1</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
          <managed-property>
               <property-name>configuration</property-name>
               <property-class>myapp.model.Configuration</property-class>
               <value>#{configuration}</value>
          </managed-property>
     </managed-bean>
     <managed-bean>
          <managed-bean-name>beanN</managed-bean-name>
          <managed-bean-class>myapp.model.BeanN</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
          <managed-property>
               <property-name>configuration</property-name>
               <property-class>myapp.model.Configuration</property-class>
               <value>#{configuration}</value>
          </managed-property>
     </managed-bean>
The Java code of each bean would look like this:
     public class Bean1 {
          protected Configuration configuration;
          public void setConfiguration(Configuration aConfiguration) {
               configuration = aConfiguration;
     public class BeanN {
          protected Configuration configuration;
          public void setConfiguration(Configuration aConfiguration) {
               configuration = aConfiguration;
One enhancement of this approach obviously is to define a super class for the beans which holds the configuration variable and its setter to prevent duplicate code. This would look like this:
     public class SuperBean {
          protected Configuration configuration;
          public void setConfiguration(Configuration aConfiguration) {
               configuration = aConfiguration;
     public class Bean1 extends SuperBean {}
     public class BeanN extends SuperBean {}
And now for the real problem. I'd like to use the advantage of using a superclass in the Java code on the faces configuration aswell. That means, I'd like to define the dependency injection only once for all beans extending SuperBean and not for every single bean. Probably like this:
     <managed-bean>
          <managed-bean-class>myapp.model.SuperBean</managed-bean-class>
          <managed-property>
               <property-name>configuration</property-name>
               <property-class>myapp.model.Configuration</property-class>
               <value>#{configuration}</value>
          </managed-property>
     </managed-bean>
     <managed-bean>
          <managed-bean-name>bean1</managed-bean-name>
          <managed-bean-class>myapp.model.Bean1</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
     </managed-bean>
     <managed-bean>
          <managed-bean-name>beanN</managed-bean-name>
          <managed-bean-class>myapp.model.BeanN</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
     </managed-bean>
Of course this doesn't work because JSF does not lookup superclasses automatically. But I would be grateful if anyone has a solution or an idea for achieving this, because it would notably simplify the faces configuration.
These are the directions my own investigations took me so far:
- Using an "extends" attribute: <managed-bean extends="superbean">
This would be nice, but it would mean to use my own JSF implementation. I often use "extends" attributes on XML configurations, because it brings the pattern of inheritance with all its advantages to XML.
- Right now I'm checking if a custom PropertyResolver could do the trick.
Looking forward to your suggestions.
Regards
Frank

There is no way in the default JSF implementation.
You may consider to replace the getter by the outcome of FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().get("configuration"); This will return the application scoped managed bean instance with the managed bean name "configuration".

Similar Messages

  • Configuration Manager Properties - there are only 2 Actions

    Hello everyone,
    My company has been using SCCM for a long time. Recently, clients got issue that there are only 2 Actions in Configuration Manager Properties. I tried to force install client from SCCM server but other Actions still has not come yet. How can I fix this issue?
    Le Nhut Minh PwC Vietname Limited.

    [CCMHTTP] ERROR: URL=HTTP://VN-SGNSCCM001.vn.mekong.asia.ad.pwcinternal.com/SMS_FSP/.sms_fsp, Port=80, Options=224, Code=0, Text=CCM_E_BAD_HTTP_STATUS_CODE    FSPStateMessage    09.10.2013 15:11:52    9820 (0x265C)
    Successfully sent location services HTTP failure message.    FSPStateMessage    09.10.2013 15:11:52    9820 (0x265C)
    Make sure that the MP is working. Examine mpcontrol.log (on the MP) and open the following URL in IE: http://MP/sms_mp/.sms_aut?mplist and http://MP/sms_mp/.sms_aut?mpcert (<Servername>
    Torsten Meringer | http://www.mssccmfaq.de
    Here is mpcontrol.log file
    http://sdrv.ms/1alvDr0
    I can access the link from web browser like below screenshots:
    What should I do now brother?
    Le Nhut Minh PwC Vietname Limited.

  • Communication lost - Same installation, same version of client (.exe), but client has different configuration in Configuration Manager properties

    Hi, I can't understand how I get the following different between old and newly installed client. On the left side it is the original client configuration and on the right side it is what client gets after installing the same version of CCMSETUP.EXE (5.00.7958.1000)
    with SCCM 2012 R2.
    Differences noticed:
    -Catalog's name (in Software center) are different. New client has "IT Ogarnization" as name for their catalog.
    -Configuration Manager Properties for new client doesn't have "Configurations" Tab.
    -Many Components status in the components tab are different: CCM Notification Agent, Compliance and Settings Managment, Hardware Inventory Agent, Out of Band Mangement Agent...
    With all this, I can't send Windows updates or any applications to ANY clients. The client status in the monitoring deployment always shows "Unknown". 
    I don't think it is on the client side, because I return to older VMware snapshot and see the different, after uninstalled and re-installed the SCCM agent, I get the new "problematic" client configuration.
    Any suggestion to resolve my problem? Thank you in advance.
    bsuperkid

    Here the all three logs. Sorry to give them like that but I think it is best way to let you take a look. I did change some name and reference to hide my environment. 
    Also, I don't know if there a link with my problem, but I guess so.
    - I noticed in Monitoring\System Status\Components Status\"Warning SMS_WSUS_SYNC_MANAGER", the following message (ID 6703):
    WSUS Synchronization failed.
    Message: Thread was being aborted.
    Source:
    Microsoft.SystemsManagementServer.SoftwareUpdatesManagement.WsusSyncAction.WSyncAction.SyncWSUS.
    - I noticed in Monitoring\System Status\Components Status\ "Warning SMS_AD_SYSTEM_DISCOVERY_AGENT", the following message (ID 5203):
    Active Directory System Discovery Agent reported errors for 2074 objects. DDRs were generated for 0 objects that had errors while reading non-critical properties. DDRs were not generated for 2074 objects that had errors while reading
    critical properties.
    Possible cause: The site server might not have access to some properties of this object. The container specified might not have the properties available.
    Solution: Please verify the Active Directory schema for properties that are not replicated or locked.
    Refer to the discovery logs for more information.
    I'll upload a print screen of all three logs files. If you need it in text format, I'll upload them as the code Block.
    Thank you again!
    bsuperkid

  • Is there a way to configure NTFS file system on an NSS 324 SmartStorage unit. So far I can setup ext 3 or ext 4 but no option for NTFS

    Is there a way to configure NTFS file system on an NSS 324 SmartStorage unit. So far I can setup ext 3 or ext 4 but no option for NTFS. This unit should be joining a Windows Server 2008 R2 network and needs to be shared with all users. This unit will replace a File server running Win 2003 SP2.
    Message was edited by: Hermann Koster
    Thank you very much for your reply. The idea is to decommission the Windows file server which is running Windows Server 2003 SP2 operating system but is not running as a DC but just a member server. All this server is doing is providing file server services so my idea is to replace it with the NSS 324 box. My only concern is that when my NSS joins the domain all my users would be able to see and access network shares transparently, the same way they saw the former W2003 file server. After I transferred the data from File server I will use the same for NSS that was used for file server as well as same IP address and folders path as before.
    Any suggestions or advice?
    Once again thank you very much for your reply.
    Cheers,

    The internal HDDs must be formatted in either EXT3 or EXT4 file system because NSS uses Linux OS.  This is mainly because the RAM designed to fit with the customized Linux OS's size.
    You can connect to an external HDD via a  USB or eSATA port. The external HDD's file system can be NTFS, FAT32, AFT or EXT3/4 to be recognized for read/write. You can connect a 2TB USB/eSATA drive connec to the NSS via USB port to format your HDD for NTFS, AFT, FAT32, or EXT3/4 partition.
    You can join the NSS to a Windows domainr so all domain users to access NSS. You cannot replace the NSS for the Windows 2003 SP2 server. They are two different products and do different jobs. Windows server is features sets server while the NSS is the files/data server.
    Hope that helps!!

  • Is there any way to Authorization Management for Material Components?

    Hello every body
       Is there any way to Authorization Management for Material Components? 
       For example  i want to create , delete , modify  Material Components,how i can Authorization Management ?
       Enhancement or IMG or other ways?
                                                                                    thanks

    Alas, no, not in VBA.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Is there a way to Configure "Silent Monitoring" in CUCM with the following conditions: ?

    Is there a way to Configure "Silent Monitoring" in CUCM with the following conditions: ?
    -no UCCX platform
    -cisco phone is CP-6941.
    I have read some cisco docs pertaining to Barge and cBarge, however i see that as one-to-one arrangement.
    Is there a way to configure in cucm, something like an ad-hoc conference wherein the Observer will
    just call the extension number to be observed?
    or something like "service observed" feature in Avaya wherein the Observer will dial a particular
    passcode followed by the extension # of the agent, then he is able to observe the on-going call.

    You can do continous recording using SPAN ports or DMS with 3rd party products like Verint Impact 360.
    not sure about the legalities around that though.
    =============================
    Please remember to rate useful posts, by clicking on the stars below.
    =============================

  • Is there any way to configure storage queue message encoding for Web Job's QueueTrigger?

    We have a web job that listens to Azure storage queue via QueueTrigger. The queue messages are not encoded when they are added to the queue:
    CloudStorageAccount account = CloudStorageAccount.Parse("...");
    CloudQueueClient client = account.CreateCloudQueueClient();
    CloudQueue queue = client.GetQueueReference("test1");
    queue.EncodeMessage = false;
    queue.AddMessage(new CloudQueueMessage("hello world"));
    And in the web job, we use the below method to listen to the queue.
    public static Task ProcessQueueMessageAsync([QueueTrigger("test1")]string message)
    And the web job crashes when it gets a message, with the below output. Unfortunately we cannot control the encode setting of the coming messages. So, our question is, is there any way to configure queue message encoding for Web Job's QueueTrigger?
    Thank you for any help and/or suggestion.
    Found the following functions:
    WebJobTest1.Functions.ProcessQueueMessageAsync
    Job host started
    Unhandled Exception: System.FormatException: Invalid length for a Base-64 char array or string.
    at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
    at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
    at System.Convert.FromBase64String(String s)
    at Microsoft.WindowsAzure.Storage.Queue.CloudQueueMessage.get_AsString()
    at Microsoft.Azure.WebJobs.Host.Storage.Queue.StorageQueueMessage.get_AsString()
    at Microsoft.Azure.WebJobs.Host.Queues.StorageQueueMessageExtensions.TryGetAsString(IStorageQueueMessage message)
    at Microsoft.Azure.WebJobs.Host.Queues.QueueCausalityManager.GetOwner(IStorageQueueMessage msg)
    at Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueTriggerExecutor.<ExecuteAsync>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueListener.<ProcessMessageAsync>d__11.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.<>c__DisplayClass1.<Throw>b__0()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    Press any key to continue . . .

    Hi,
    Thanks for posting here.
    I am not too sure if the storage queue messages can be encoded before the webjob listens to it.
    I am currently researching to gather more information with regards to your request.
    I shall revert back to you with an update at the earliest.
    Sincerely appreciate your patience.
    Regards,
    Shirisha Paderu

  • Is there a way to configure win 8 Laptop to airport express?  I can see theN connection to the wireless network, but troubleshooter suggests there's t

    Is there a way to configure win 8 Laptop to airport express?  I can see the connection to the wireless network, but troubleshooter suggests there's there is no gateway and of course no internet. The connection
    shows limited.  Any help you could provide would be most appreciated.  Further, should I simply buy another router for the windows machine?  If I did that, would it interfere with the airport?

    The internal HDDs must be formatted in either EXT3 or EXT4 file system because NSS uses Linux OS.  This is mainly because the RAM designed to fit with the customized Linux OS's size.
    You can connect to an external HDD via a  USB or eSATA port. The external HDD's file system can be NTFS, FAT32, AFT or EXT3/4 to be recognized for read/write. You can connect a 2TB USB/eSATA drive connec to the NSS via USB port to format your HDD for NTFS, AFT, FAT32, or EXT3/4 partition.
    You can join the NSS to a Windows domainr so all domain users to access NSS. You cannot replace the NSS for the Windows 2003 SP2 server. They are two different products and do different jobs. Windows server is features sets server while the NSS is the files/data server.
    Hope that helps!!

  • Is there a way to configure Mac Mail ...?

    I have an IMac desktop, a MacBook & a 4th generation IPod Touch.  As it now stands whenever I receive email it goes to all 3 devices necessitating the need to physically read and/or delete the messages from all 3 devices.  Is there some way to configure Mac Mail to eliminate these steps or do I just have to keep manually removing mail messages as I'm now doing?
    Thanks for any help you may have.

    Create your accounts for IMAP instead of POP.
    Here's a little youtube explaining the difference (ignore the sales pitch).
    imap vs pop - what do they do?
    In Apple Mail preferences, Accounts, when you go to set up a new mail account you click the plus in the lower left as usual.  When the Add account sheet is displayed if you press the option key while clicking the Continue button you will be given a window to define the account as POP or IMAP.
    Alternatively if you enter an invalid email address into the Add Account window and juct click Continue (no option key) you will again be given the IMAP/POP choice.  This technique I think will work in the other itoys as well.

  • ESB - Is there a way to set context properties when using esb custom pipeline

    Hi there,
    I have a situation where I am using a oneway wcf sql custom receive adapter to polling db and a two-way solicit response wcf sql send adapter to update the db and receive a result back.
    Now I had got this working by setting the BTS.Operation and BTS.MessageType properties using a custom receive pipeline on the receive port. FOR SOME REASON THESE TWO WERE NOT SET BY THE RECEIVE PORT !!!
    Now I have decided to wrap all that in en ESB itinerary by converting the send port into a dynamic one.  I get the following error:
    Exception of type 'Microsoft.BizTalk.Message.Interop.BTSException' was thrown. 
    Since I am using the ESB pipeleine - ItineraryReceiveXML I am not able to set the BTS.Operation and BTS.MessageType explicitly in a pipeline neither can I derive a pipeline form the ESB pipeline as it's a sealed class.
    So my questions are:
    1. Any idea what the above error could be  ?
    2. Also is there a way I get set context properties using an ESB itinerary as that is the only difference from before, can I do that in a map ?
    Thanks
    Phanindra

    BTS.MessageType is typically set by one of the Disassemblers.
    BTS.Operation has nothing to do with the Receive Port/Location and is set by the Engine only when coming from an Orchestration Port.
    But, you can set any Property in any Stage with a custom Pipeline Component as you've found.
    "Exception of type 'Microsoft.BizTalk.Message.Interop.BTSException' was thrown."
    There's usually a lot more to the stack trace.  You'll have to include the whole thing.
    Finally, what benefit do you expect from adding the ESB layer?  This is pretty trivial with an Orchestration.

  • Is there a way to edit/manage Launchpad?

    is there a way to show the apps and a list, mark them into groups, and then move them into folders?
    I like the idea of Launchpad, but this isn't my iPad where I have a few apps that I use all the time.
    I have approximately 300 apps ... many of them farily useless things that came with packages (e.g. the Adobe utilities that come with Creative Suite, or the updaters that World of Warcraft uses).
    Drag and drop takes forever ... you can only move one app at a time. (And dropping an app into a folder that's at the end of a line is a little game all itself.)
    And then once they're in the folders, there's no way to tell which is where. I have 5 screens of folders ... and there's a lot of flipping around involved in finding something that I haven't used recently.
    It would also be nice to be able to mark some of the folders as "hidden", since they contain apps that I will likely never use.
    To be honest, I'm starting to think that this isn't going to work. The Finder's "Recents" lists get me to about 70% of everything I need, and searching Finder windows seems faster than LaunchPad.

    Thank you ... unfortunately, I've already used those.
    You can't put folders in folders ... so there's no hierarchy. And you can only put ... it looks like 32 files in a folders ... so you need "Folder1, Folder2, etc. for categories."
    I've had time to read some other posts, and I think I get it now. The Applications Folder is hard to look at because it has so many entries. And if you create your own subfolders, it messes up some programs.
    So ... Launchpad is a collection of aliases.
    I think that's a good idea, but right now it's just a big pile of icons. There needs to be a way to organize it ... and the current one-level folder mechanism just isn't sophisticated enough.
    So thanks again ... I'm going to just stop trying to use Launchpad and stick with my old way of doing things for now. Maybe Apple will improve it later.

  • Is there a way to configure screen sharing to mirror?

    In past versions of OS X, if you used VNC to screen share, it mirrored the display. Now in 10.7, it displays a logon screen. Is there a way to revert it to the old way??

    Hi dosers;
    You posted your iChat question in the Leopard forum. If you really want to have this seen by the iChat heavyweights, you might want post over in the iChat Forum instead.
    Allan

  • Is There A Way To Configure A PC to Use iCloud Web Mail As Default?

    Greetings!
    I searched through through the community and didn't come across an answer to my issue/question so I thought I would post this to see if anyone can help me.
    Curently I have a Windows 8 PC.  I do have plans to get an iMac when I can reasonably afford it. 
    I have decided to use the Apple iCloud mail at iCloud.com as my email and am not using any other nor do I have any other mail clients installed on my PC.  Is there a way to make Windows use the iCloud.com mail service to send mails when clicking on email links from web pages?
    Thank you so much in advance for your time and attention to my question!
    Thanks!
    Bill

    Thanks Roger.
    I don't have as much an issue with the access to the Apple account so much as setting it up on my kid's iPhone (say...) also pulls my personal emails too. I want to give them access to the iCloud - just not my emails!
    Should I do this by setting up an alias in iCloud and setting their access using *that* ID?

  • Is there a way to centrally manage Apple IDs for phones and iPads issued to employees?

    This is more of a best practices queston I suppose. We are starting to issue more and more iPads and iPhones. As the IT Director I would like a way to centrally manage folks' Apple IDs so the company can purchase approved apps and control iCloud backup. It would be so much easier to have some sort of web interface or way to issue myself so I dont have people running around with their own Apple IDs an account on their company issued devices.
    What are some tips for accomplishing this?

    robphoton2 wrote:
    I did not even realize I had a problem here until I started using iCloud.
    iCloud is a TOTAL MESS.  Here is why:
    1.  I can no longer synch all my apps to my device.  Only the ones bought with the Apple ID tied to my device.  Unlike the desktop, it appears I can not sign off on my iPhone or iPad with one ID and then sign on again with another in order to be able to update them.  I now have over 1 hundreds Apps that are orphened on my phone and iPad that I can no longer update!!!!!!!!!!!!!!!
    The problem arose when I wanted to sign in my iPhone to iCloud.  When I tried to do that it would not accept my original Apple ID so I had to use one that I think I was using with Mobile Me.
    Until we can merge our Apple IDs, people with this issue will have a failed iCloud!!!!!
    Something's wrong here.  The Apple ID is unrelated to syncing.  As I had stated earlier, I also have two IDs but have had no problem whatever syncing, including syncing over the air (which is really cool).  My only problem is in updating apps.  The iPod handles it automatically but, with my Mac, I need to log out of one account and into the other.
    Perhaps we can address one part of your problem first.  When the iPad detects that an app needs updating and and you're on the "wrong" ID, exactly what happens when you attempt to update the app?

  • Is there any way to configure domain name in place of IP address for "Peer VPN device"

    Hi,
    When I configure site to site vpn on asa it asks for the ip address for the remote vpn device and it works pretty fine if I confgure like this.
    The problem is that the remote vpn device does not have static IP address, it changes on every reboot. I have configured Dymamic DNS for the interface but the problem is ASA does not take domain name as the "peer vpn device" address.
    Is there any work around for this issue so that I don't need to configure vpn from scratch everytime the ip address of the remote device changes.
    P.S. ASA vpn configuaration also does not allow me to change just the ip address of the remote device in the VPN configuration, I have to delete the current vpn and confgure a new one from the sratch everytime the ip address changes.
    Thanks

    Hello Mahendra,
    yes you can set a hostname in the 'crypto map set peer' command insetad of IP address, however, the ASA will resolve that name only once it is applied, hence, it will take the IP that name currently holds, and if it changes, it will not update it.
    the easy solution for your case is to use static-to-dynamic L2L configuration. on your ASA, configure a dynamic crypto map, assign it to the static crypto map you have, and then add the pre-shared key to the Default L2L tunnel-group.
    an example is given below:
    crypto dynamic-map dyn_map set transform-set
    crypto map VPN ipsec-isakmp dynamic dyn_map
    tunnel-group DefaultL2LGroup ipsec-attributes
    pre-shared-key
    this way, you must initiate the tunnel from behind the remote device (not your ASA where the dynamic crypto map is configured) and it should work fine.
    the document below explains that in details:
    http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_configuration_example09186a00807ea936.shtml
    hope that help
    Othman

Maybe you are looking for

  • Passwordless ssh login using kerberos in Directory Server 5.2

    Hello all, I am trying to do passwordless ssh login in directory server 5.2 . I have done everything on directory server and client such as enabling sasl/gssapi, configuring kdc, creating gssapi profile, identity mapping, configured client with that

  • Unable to generae pdf from Framemaker

    Hi All, I am experincing some error while  generating pdf from Framemaker 10. The generated pdf is not displaying the content in all the pages and even most of the tables are also appearing blank. Does anyone know what is the error behind this? Pleas

  • Duplicated albums

    match has duplicated some albums of mine so i have to listen to a tune twice before moving on to the next track.i can't delete one or the other ........help

  • After system copy (ccm), how to change logsys in catalog items?

    Hello all We're still on ccm 2.0 sp03 and did a system copy of our production ccm system to our test ccm system. But the catalog items still refer to the production logical system being the production R/3 system. How can we change the logical system

  • Installing Oracle Applications E-Business Suite R12  error

    hi everyone i have error while installing Oracle Applications E-Business Suite R12 on Windows server 2003 R12 plz help me this is log file: Processing DriverFile = E:\Oracle R12\Oracle12_Source\Oracle12\stage12i\startCD\Disk1\rapidwiz\template\adriap