Can I create a Managed bean myself and pass it to JSF?

Hi,
Is it possible to create a managed bean in my code and pass it to JSF. I basically want JSF to take care of the data transfer from the request to the bean but I want to create and load the bean myself.
If that's possible would you mind leaving me some code example on how to pass it to JSF.
P.S.: I know that a managed bean is essentially an ordinary bean configure in the faces-config.xml as a managed bean. :)
Thx

(1)Why do you need manual instantiation of the 'managed' bean?I know such a case.
Suppose you already have an EJB application and want to use JSP to display the result of the EJB call which is returned as a JavaBean.
One solution is put your bean to SessionMap with the name specified in faces-config.xml.
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("name", bean);
But, I hate this solution because it hard-codes the name of the bean.
My favorite solution is to provide the result bean as a property of another managed bean.
public class ManagedBean {
    private ResultBean result;
    public ResultBean getResult()  {return result;}
    public String action() {
        result = /* call EJB */;
         return "ok";
}Page authors can refer the result bean as #{managedBean.result}.

Similar Messages

  • I have multiple devices (imacs, lap tops and ipads) all connected to a NAS server.  Can I create a user for myself and one for my wife, and each have our own apple ID, and Itunes accounts, but all share the same media on NAS drives?

    I have multiple devices (iMacs, Lap tops, Ipads) all connected to a Nas Drive.  Can I create a user for myself and one for my wife and we each have our own apple ID's, Itunes etc, but share the same data on the hard drives?  So when she logs in, and sync's her ipads, they will sync with her stuff and when I do the same under my user account, on the same device, my ipads will sync with my stuff?

    You can share the same Apple ID for purchasng form the iTunes and app stores without any problems, but you should all used separate iCloud accounts with separate Apple IDs.  (You are not required to use the same ID for iCloud and other services as you do for the iTunes store.)  This will prevent you from ending up with merged data.  You should also use separate Apple IDs for iMessage and FaceTime or you will end up getting each other's text messages and FaceTime calls.
    This article may be of interest: http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/, as well as this video: http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l.

  • JMStudio Error  "Can not create session manager"

    Hi,
    I'm trying to transmit an mpg file through a simple pc to pc network, using the transmission wizard in the JMStudio, and everytime it causes a "can not create session manager" error, even when I try to transmit .mp3 file
    I'm using an ip like 100.100.0.1 for the sender machine, and 100.100.0.2 for the receiver machine, and I don't know where is the problem
    thanks in advance

    Um,maybe the port that you use for transmission is already occupied.
    Make sure that you are not using JMStudio to transmit streams while trying to receive streams from the same port.

  • How can I create a new iCloud account and transfer my apps?

    I'm sharing an iCloud and iTunes account and want to have my own. Can I create a new iCloud account and transfer my contact list? If I keep the existing iTunes account with the new iCloud acct, can I reload my apps without purchasing them again? I understand I can create a new iTunes acct afterwards.

    OK, so you can create a separate Apple ID for yourself that you use for your Messages, iCloud, Mail, FaceTime, etc. and keep the one that you have your Apps on as your iTunes "Family" Account.
    Before you set up your new Apple ID, be sure to delete your iCloud account from your device: Settings>iCloud, scroll to the bottom and delete the account. Save your Contacts on your phone so you can merge them with your new iCloud account. Your notes, and Photos will still be on your old iCloud account, but if you want to keep any of your photos on your new iCloud account, it would be a good idea to import all of your photos to your computer first, so you can selectively download them to your device. (Note: only your Photo Stream will go away when you delete your iCloud account. Your Camera Roll will stay in place. It's just a good idea to back up that Camera Roll to a computer or to your new iCloud account immediately once you have set it up.
    You then would set up a brand new Apple ID for you under Manage your Apple ID: Apple - My Apple ID
    Once you get it set up, go into your devices and sign off the following:
    Settings>Messages>Send & Receive, click on your "Family" Apple ID and Sign Out
    Settings>Facetime, click on your Apple ID and sign out
    You will leave your "Familiy" Apple/iTunes ID signed on on the iTunes & App Store, becasuse you willl continue to share your iTunes account with the family. Here is a little more info about using two Apple IDs:
    Using your Apple ID for Apple services
    Once you have your new ID set up, go back into Messages and FaceTime and sign back in with your new ID
    Also, go to Settings>iCloud and sign in with your new ID, and be sure to "Merge" your contacts into your new iCloud account.
    Post back with any questions!
    Cheers,
    GB

  • How can i create link between ipad(xcode) and webserver?

    Hi, I'm a new to iPad development and i need help,
    i'm not good with english but i try to explain my question:
    how can i create link between ipad(xcode) and webserver?
    (the webserver ".NET" with driver odbc is connected with DB Oracle)
    so, how can my ipad application access to the Oracle DB?
    Create a webservice (.NET) to be place between iPad and DB, is this correct?
    how can i do it?
    which are libraries to include in the xcode's framework?
    thx

    I think the following URL will be your best answer:
    http://stackoverflow.com/questions/3510468/connecting-iphone-to-an-odbc-database

  • Can I Create a New User Account and Move Existing Account ???

    Lion was reinstal.
    I'm suspecting issue with one user account.
    Can I creat a new user account and move all my files to that new user?
    What are the impact?
    How about permissons on this files?
    What about the Library Folder?
    Thank you for your help and support.
    BigBlaze

    This should help you out after  you have created the new user account. You are trying to make it much more complex than it needs to be. Just follow the directions in:
    Transferring files from one User Account to another.

  • Can I creat an new iCloud account and make it the primary one for my backups and buy extra iCloud storage for it?  Thank you

    Can I creat an new iCloud account and make it the primary one for my backups and buy extra iCloud storage for it?  Thank you

    Hey Hindfromlondon,
    Welcome to Apple Support Communities.  Since you are posting here, I take it you already have an Apple ID.  
    You can setup that Apple ID to work with iCloud.  See:
    Set up your Apple ID for iCloud and iTunes - Apple Support
    And you usually want to stick with one Apple ID as having multiples can cause confusion (especially with purchases).
    Frequently asked questions about Apple ID - Apple Support
    What is an Apple ID?
    An Apple ID is a user name you use for everything you do with Apple. Creating an account for an Apple service, such as the iTunes Store or the App Store, creates an Apple ID. Apple ID allows you to access other Apple services. You don't have to create a new account for each service—just use your Apple ID.
    For a complete list of all of the places you can use an Apple ID, see Where do I use an Apple ID.
    and further down:
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs. 
    If you are wondering how using multiple Apple IDs relate to iCloud, see Apple IDs and iCloud.
    Regarding iCloud storage check out
    iCloud storage upgrades and downgrades - Apple Support
    I encourage you to read all about it as there's lots of information out there.
    Take care,
    Nubz

  • Can I create a fillable pdf form and then export it for client use on my web site?

    Can I create a fillable pdf form and then export it for client use on my web site?  I need clients to be able to fill in the (registration) form on my site then submit it via email.

    [discussion moved to Creating, Editing & Exporting PDFs forum]

  • Can I create a "stage" in Animate and use it in Muse to create a responsive site?

    I want to use Muse to build my site and Animate for some elements. I need a responsive site. Muse does not do that but Animate does. That is crazy! How can I combine them? There has got to be a way. Someone smarter than I has figured it out I am sure, I am hoping they chime in.
    Can I create the "stage" in Animate and use it in Muse?

    You are probably right but I was looking for the ease in creating only one and letting it do the work.
    Now that I think about it....my site will have video embedded and a link for Ustream. That won't work on a mobile device if it is part of a responsive design will it?
    Oh, there is soooo much to all of this!
    Newbie anxiety!
    This is why I chose Muse and Animate, I am too new to code it on my own.

  • Can I create a site in Muse and export to Word Press?

    Can I create a site in Muse and export to Word Press?

    Hi,
    check this discussion
    Re: I want to know Muse can export to Wordpress ?

  • Can I create a site in Illustrator and then import it into Muse?

    Can I create a site in Illustrator and then import it into Muse? If not, why not?

    No, you can't and it kinda defeats the purpose of Muse altogether. Thats like saying, "Can I use Muse to create vector graphics for designing logos?" Or, even simpler " Can I use this hammer to unscrew this picture hook in my wall?"
    Muse would import that AI file as an image only. So, you would have one big picture and no functionality to any buttons, menus etc.
    I would suggest that you try downloading the trial version of Muse. If you could/would design a site in AI ( despite it being an unsuitable tool ) you will find Muse just as easy to use. If you are proficiant in Illustrator or InDesign, Muse's interface is very familiar and uses similar techniques.

  • Can we create secondary indexes in pooled and cluster table?

    hello all
    can we create secondary indexes in pooled and cluster table?

    Hi,
    Yes, you can.
    Refer the below links
    [http://www.sap-img.com/abap/the-different-types-of-sap-tables.htm|http://www.sap-img.com/abap/the-different-types-of-sap-tables.htm]
    [http://help.sap.com/saphelp_40b/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm|http://help.sap.com/saphelp_40b/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm]
    Regards,
    SB

  • Can I Create A B-Spline Curve and a NURBS Curve?

    Can I create A B-Spline curve and a NURBS curve in the Adobe Illustrator?
    If yes, how to do it?
    Also, how to create a breakpoint, that will add a new control point, on a curve, in Adobe Illustrator?
    Many thanks

    Mylenium wrote:
    All Splines in AI are Bèziers. There is no way to create other curve types. For the rest simply refer to the help on how to use the path tools.
    Mylenium
    I know that all splines are Bezier's, a.k.a Bezier invented them (please CMIIW).
    For example:
    B-spline = Bezier's spline
    NURBS = Non-Uniform Rational Bezier Surface
    I think all of the curves created by using the pen tool is a linear, quadratic, and cubic Bezier curve.
    I hope you understand what I am talking about.

  • Can we create Mobility group between WISM2 and WLC 5500

    Dears,
    I need your feedback urgent please,
    Can we create Mobility Group between WISM2 and WLC 5500
    Firmware for WISM2 > 7.4.121.0
    Firmware for WLC5500 > 6.0.196.0
    I created Mobility Group with (IP address , MAC Address and Mobility group name) for Foreign Controller. if any configuration required from my side.
    Wait your feedback urgent please
    Regards,

    Hi,
    Controllers do not have to be of the same model to be a member of a mobility group. Mobility groups can be comprised of any combination of controller platforms.
    Thats enough :)
    Regards
    Dont forget to rate helpful posts

  • Can i create an entity bean to part of a table

    Hi there,
    I am using EJB 2.0.
    Can i create an entity bean to part of a table.
    Thanks
    Edited by: vamseebobby on Nov 5, 2007 11:11 AM

    of course,provided the other parts left out have not constraints.
    sumelong

Maybe you are looking for

  • [865PE/G Neo2 Series] I Messed Up My Computer Really Bad

    Wow.  Where to begin. I was in my BIOS looking at DRAM timings and Frequencies... noticed that there for DDR500 it had (4:5), which I presume means the RAM runs out-of-sync with the processor.  I tried it out to see what it would do. Well, my compute

  • Problem Connecting my iPAD3 to WiFi - LAN

    Untill today using ADSL broadband and ZyXel WiFi Router. With this I was able to connect iPad3 to internet. iPad --> ZyXel WiFi Router --> Internet. I changes my internet service provider to Hathway. So I connected WiFi Router <--> Cisco Cable Modem

  • To distribute the qty with source

    Hi I already have total qty in my report I wanted to have bifercation of that quantity with source for ex toatl qty    qty       source 200           100       112                  100       231 how can i achieve the above if we already have total qt

  • Can you block phone calls on the iPhone

    Can you block a phone number on the iPhone?

  • How to connect Java with Acces (DSN Less)

    Hi, I'm try to connect an Access DataBase in Java with an example. I find it in this forum, but don't work... I've my database in the folder Data, and its name is BaseDat.mdb... I'm working in NetBeans 5.5, and the DataBase is in the Folder: "C:/Docu