Using a backing bean in JDeveloper to assign bean class variables

I am using JDeveloper 10 to make a jsp page that is a form full of inputs and buttons. JDeveloper then creates the setters and getters for you for the ids of the various inputs and buttons. I also have used JDeveloper to create a backing bean.
The idea of this is to have the backing bean read in parameter(s) from an http source/link(when the form is loaded or instantiated) and assign those parameter(s) to one of the bean class local variables.
The reason i want to do this is, is that when the form is loaded the first thing it will do is open up an available database(in the bean class constructor), then in the constructor call a function to do a database query that will return a result set that will then be used to fill up the form.
That variable that is assigned by the backing bean will be the value of a unique database identifier for doing the sql query so that is why it is important that i get this value as the form loads.
So simply i need to find out from someone how to do this. i am totally new to doing any jsp development or using managed beans and i have gotten far enough to launch the form, retrieve and write to the database using sql queries and all the rest.
I just dont know enough about managed beans to make a decision on things like making the bean have a session scope. do i need request scope? if i change to request scope how do i make sure the database isn't being called every time the page changes or is refreshed?(when i had it as request scope the constructor was being called every time the page was reloaded and that isnt effecient at all, especially with multiple users). can you define more than one managed bean in one faces config file? do i have to manually change something in the jsp file to make sure things run smoothly?
Just maybe things are easier than i see them to be and my only problem is that i just dont understand what i am doing. here is what my backing bean looks like now with just basic session scope.
An example of course would be something like: http://host:port/context-root/faces/register.jsp?12345 - where 12345 would be the value that i would like to assign to a local variable in my bean class that can then be used for filtering out information via a query then filling up the form, all this happening at instantiation.
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
<managed-bean>
<managed-bean-name>beanpackage</managed-bean-name>
<managed-bean-class>beanpackage.beanclass</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<!--oracle-jdev-comment:managed-bean-jsp-link:1register.jsp-->
</managed-bean>
</faces-config>
This is what i have now, i've tried tons of stuff on the web like assigned value parameters but just am stuck on exactly what to do as nothing has seemed to work. Any help would be appreciated. Thanks in advance!

Hi,
don't think you will get a readily programmed solution to this (though I wish you luck). Here's how I would approach the managed bean issue
- One managed bean that you configure from a java.util.HashMap. This bean should be in requestScope (should be okay here). Say the bean is called "formFields", then adding data to it can be done with the following EL #{formBean['attribute_name']}. You need to add this as the value Expression of the inputText field you create dynamically. The filed will then read and write to the HashMap
- Create a managed bean in session scope to handle the database interaction. Put this into session scope (e.g. "database")
- Create a managed bean that holds the action listener that handles the update, insert and delete actions (e.g. logic handler). This bean has a JSF reference to the root component in the page (or the form layout component to add the fields to)
The "database" bean is referenced from the logic handler managed bean using the #{database} expression, which you resolve using a ValueBinding (ExpressionBinding in JSF 1.2). Or, you configure the bean as a managed property.
The logic managed bean also needs to reference the formFields bean (similar to above) to access the contained filed names and attributes. If the filed attributes match column names in the database then you should be all set
Frank

Similar Messages

  • Problem creating EJB 3.0 Entity bean in JDeveloper

    Hello all,
    I trying to create my first entity bean in JDeveloper.
    JDevelper create the entity bean with the code below:
    package model;
    import java.io.Serializable;
    import javax.persistence.Entity;
    @Entity
    public class BatchSettlementT implements Serializable {
    public BatchSettlementT() {
    The problem is that JDeveloper don't find the import command import javax.persistence.Entity;
    What am I doing wrong?
    I'm using JDeveloper Studio Edition Version 10.1.3.1.0.3914.
    My libraries are:
    - TopLink
    - Oracle XML Parser 2
    - EJB 3.0
    - Toplink Essentials JPA
    - J2EE
    Thanks in advance.

    It's very strange, when I type import.javax. in my class there is no persistence package available, do you have any idea what's wrong.
    I did set the technology scope to EJB either.
    Thanks!

  • Whats new in JDeveloper and OBI Beans ?

    Hi pals,
    I hav a little bit confussion regarding this OBI Beans and JDeveloper.Pls help me out to know what exactly is JDeveloper ?, What exactly we do with JDeveloper ? and why we use JDeveloper ?
    Is there any relation between OBI Beans, JDeveloper and OBIEE ?, if so what is that.
    Thanks regards
    suresh.

    hi user,
    good n nice decision,
    for ur reference
    ERp
    luk here john says, important point.
    adf business components n Ejb Concepts
    Edited by: Erp on Oct 12, 2011 4:03 AM

  • I would like to know if you have to back up a macbook hard drive, can I use a external hard drive that has been previously used to back up several pc 's, or is it best to have a separate external drive for the Mac?

    I would like to know if you have to back up a macbook hard drive, can I use a external hard drive that has been previously used to back up several pc 's, or is it best to have a separate external drive for the Mac?

    In the Mac side of things, backups usually come in two flavors: clones or incrementals.
    A bootable clone is a bit-for-bit copy of all essential files in the startup volume. If using the Lions, clones can be made using CarbonCopyCloner or just plain old Disk Utility. These backups represent the safest protection of your info, but take the longest to do. Recovery is an inverse process: you copy the clone back into the internal drive.
    Incremental backups start with a complete backup of the startup volume and only copy whatever changed from the previous run. OS X includes the fully integrated Time Machine backup utility to do this. It is extremely easy to do and takes the least amount of time. Recovery is another matter altogether since you have to start with a freshly installed instance of the OS and have to apply all intervening backups to bring the result to the latest saved version.
    As for where the backup takes place, the recommended media is an external dedicated drive or drives connected via the fastest interface available on your Mac: Thunderbolt, USB3, Firewire, or USB2. Network-based backups, wired or wireless, are attractive but may not offer the same performance and hence take longer. Also important to note that the entire drive need not be completely dedicated to a single backup. The Mac's EFI firmware infrastructure allows for an unlimited number of partitions on a hard drive and each can be used for either type of backups.
    Holler if you need specifics on how to do each. This was just an executive summary.

  • HT201250 I use Time Machine to back up my entire computer with my external hard drive. I am getting a brand new iMac this month and was wondering what is the process of using this back up to restore my new computer exactly how my old computer was?

    I use Time Machine to back up my entire computer with my external hard drive. I am getting a brand new iMac this month and was wondering what is the process of using this back up to restore my new computer exactly how my old computer was? I want to make sure I will still have various important files on my new computer, like my songs in iTunes, my photos in iPhoto, etc, etc. Thanks so much in advance!

    Welcome to the Apple Support Communities
    When you turn on the new iMac for the first time, Setup Assistant will ask you to restore a backup, so connect the external disk and follow steps to restore all your files to your new iMac. Your new Mac will have the same settings and programs as your old computer.
    In other cases, I would recommend to restore the whole backup without using Migration Assistant or Setup Assistant, but a Late 2012 iMac uses a special OS X build, so the OS X version that you're using on your old Mac won't work on the new one. For more information, see > http://pondini.org/OSX/Home.html

  • Why do google search results reset to match the search bar terms when i use the back button?

    Since the update to FF 23, the list of Google search results clears and the on-page search box is reset to match the address bar search box when I hit the back button to re-view the results list after checking a result.
    To see this issue for yourself, set your search provider to Google and make sure Instant is on. Type a search term into the search bar and press enter. A google page appears with your results list. Now, change your search terms or conduct a new search directly from the google page (without using the FF search bar). Click on the first result in the search list, then click the back button to return to the search results so you can check a differest result. As FF goes back to the google page, it will reset the on-page search box to match the FF search bar (although you were no longer on this search) and all search results will disappear, replaced by the message "Press enter to search". Pressing enter reconducts your old search, not the one you were on.
    This is incredibly maddening since searching for something requires frequent use of the back button to check through the list of search results, and then frequently trying the search again with slightly different terms. Although it sounds like a Google issue, it did not occur on the old firefox and has me wanting to revert. I tried to revert to the old search function via the "keyword search" addon, but this did not fix my issue. Is there a way to force FF to go back to the actual google search page I was just on instead of conducting a new google search from the FF search box when I hit the back button?

    In Firefox 23 versions and later the keyword.URL pref is no longer supported and it is no longer possible to specify the search engine for the location bar via the keyword.URL pref.<br />
    The search engine that is used on the location bar and on the about:home page is the search engine that is selected in the search Bar on the Navigation Toolbar.<br />
    Current Firefox versions do not update the about:home home page until you refresh the page (future versions will do this automatically without a refresh) and that is what happens if you use the Back key.
    You can install the Keyword Search extension to specify with search engine to use for the location bar and which search engine to use for the about:home page via the Options/Preferences windows of this extension, accessible via the about:addons page.
    * Keyword Search: https://addons.mozilla.org/firefox/addon/keyword-search/

  • Does anyone know how to use Retropect back soft ware - I need help with it

    Is there anyone familiar with Retrospect Backup software here who might be able to help me with the following problem ?
    My 2007 iMac  with the tiger 10.4.11 OS suddenly crashed exactly two weeks ago when I told the trash to empty. The reason was that some malware or virus had appeared on my computer. There was an alias icon on the desktop that linked to a core item in the system folder; that is why it crashed. It was the malware that put it there somehow.
    So, I was left with a dead computer without an operating system to make it work.
    I telephoned Applecare for help as I was clueless as to what to do. Because I can’t write the thousands of words here to describe the ghastly experience Applecare have been I will miss that out for the time being. Suffice to say it has been utterly excruciating and horrible and I have so far lost all my data, including all the software I have ever bought, because of them. That’s 23 years of writing stuff onto to all the previous Macs I’ve owned.
    So, the question is this. I have a Retrospect backup software backup in my external hard disk. This should still have all my information on as it was a backup made just the day before the computer crashed.
    But I no longer have the Retrospect software on either my external hard disk or on the computer, so when I double click on the Retrospect icon in the external hard disk I get a message asking me to find the application software to open it with. I haven’t got it ( thanks to applecare’s utter incompetence).
    Applecare had insisted that I would be able to retrieve my data from this backup if they installed Snow Leopard to make the computer work. But when I tried to do this the computer crashed again and I was left without an OS again.  Yet another visit to the ‘genius’ bar (what a joke) at the Applestore and this time they installed Leopard which ended up leaving me without any data at all.
    The Retrospect support people told me that I could only retrieve information from this backup if the computer had the original Operating system, i.e. OS Tiger 10.4.11.
    The question is, can anybody here tell me exactly how to retrieve a Retrospect backup from my external hard disk, because so far, both Applecare & Retrospect support have not been of any help at all really and I have spent every waking minute of the past two weeks trying to sort out this problem without any success so far.
    Help !

    The Retrospect you used way back when is no longer around. The company was sold and that company produced a new version of Retrospect - Retrospect 8.x
    So, as you've been told, you would have to be running a Tiger system with an old version of Retrospect software (5.x or 6.x - you would need to know) assuming you can find the software.
    As best I can remember you cannot extract files from a Retrospect backup except using the software since Retrospect did not normally make a file by file backup rather it created an archive of the files in the backup. I'm assuming that the EMC/Retrospect people have told you that old Retrospect backups are not accessible by Retrospect 8.x?

  • My back button and refresh button and my yahoo tool bar are dimmed a lot when I open up firefox. So as a result, I cannot use the back button nor my refresh button AND my yahoo toolbar disappears a lot. I have tried to get on your chat session but it is a

    <blockquote>Locked by Moderator as a duplicate/re-post.
    Please continue the discussion in this thread: [/forum/1/688252]
    Thanks - c</blockquote>
    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    My back button and refresh button and my yahoo tool bar are dimmed a lot when I open up firefox. So as a result, I cannot use the back button nor my refresh button AND my yahoo toolbar disappears a lot. I have tried to get on your chat session but it is always closed. I need one on one help. Please reply with resolution.
    == This happened
    ==
    Every time Firefox opened
    == two or three months ago
    ==
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows XP
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 (BT-canvas) Firefox/3.6.3 GTB7.0 (.NET CLR 3.5.30729)
    == Plugins installed
    ==
    *-npdnu
    *npdnupdater2
    *Coupons, Inc. Coupon Printer DLL
    *Coupons, Inc. Coupon Printer Plugin
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    *6.0.12.448
    *RealPlayer(tm) LiveConnect-Enabled Plug-In
    *RealJukebox Netscape Plugin
    *Default Plug-in
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.2"
    *BrowserPlus -- Improve your browser! -- http://browserplus.yahoo.com/
    *Shockwave Flash 10.0 r45
    *Yahoo Application State Plugin version 1.0.0.7
    *3.0.50106.0
    *My Web Search Plugin Stub for 32-bit Windows
    *Google Updater pluginhttp://pack.google.com/
    *Google Update
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    *Npdsplay dll

    * If the menu bar is hidden then press and hold the Alt key down, that should make the Menu bar appear (Firefox 3.6 on Windows) (see [[Menu bar is missing]]).
    * Make sure that you have the ''Navigation Toolbar'' and other toolbars visible: View > Toolbars .
    * If items are missing then see if you can find them in the View > Toolbars > Customize window.
    * If you see the item in the Customize window then drag it back from the Customize window to the Navigation toolbar.
    * If you do not see that item then click the Restore Default Set button in the View > Toolbars > Customize window.
    See also [[Back and forward or other toolbar buttons are missing]] and [[Navigation Toolbar items]]
    See http://kb.mozillazine.org/Toolbar_customization

  • Need help in using hashtable as a property of a form bean

    Hi,
    Is it possible to use a hashtable as a property of the bean.
    Well this is the problem i have
    I am using a hashtable as property and i want it to store from(/retrive into} form as ints/strings
    I have a
    JSP Page
    SampleAction --Action
    SampleForm --ActionForm
    Sample(bean)
    =============
    JSP Page
    (within the html:form tag)
    <html:text property="sample.number" />
    ====================
    struts-config links to
    SampleAction
    SampleForm
    ==============
    SampleForm
    Sample sample = new Sample();
    reset(){ ...impl...}
    validate(){.... impl.....}
    =================
    Sample.java
    private Hashtable prop = new Hashtable();
    public int getNumber()
       return ((Integer)prop.get("number")).intValue();
    public void setNumber(int number)
       prop.put("number",new Integer(number));
    ====================================
    this setup understandbly gives me a error like this
    no getter method for property sample.number
    PLEASE DO remember that i have a large number of mixed types in my form that needs to be populated into the bean and i detest using that many variables(in the bean)
    I NEED TO A KNOW A SOLN. PLEASE
    Thanx in advance
    cheers
    Ash

    Hi,
    I think the solution for your problem is
    put a form tag in your jsp page.
    name it as your form name defined in the struts-config.xml.
    in your case
    it is 'sample'.
    And make changes in the html:text tag like,
    <html:text name="sample" property="number" />
    Hope it will work.. have fun !!!

  • I want re-format my PC, how do I back up my itunes before I format. The same PC is also used to back-up my iPhone4

    Hi all,
    Hope you can help.
    I have a desktop PC which I want to reformat and reinstall Windows XP because I think I have a virus on it, I have also had the PC for 5 years and never done this opperation but I feel I should now.
    I have also backed up my iPhone4 on the same PC (the one Itunes library its backed up on)
    1. How do I back up my itunes onto an externall hard drive
    2. How do I make sure that my iPhone will re-sync with Itunes once I reinstall Itunes on the PC after the format (ie I dont want to see that message that iPhone can only sync with one  iTunes library)
    3. Before I format the PC do I have to de-authorise my PC?
    4. Once I reinstall windows XP and iTunes how do I make sure the my iPhone will recognise the itunes library so everything will sync again (ie. music, all, movies purchased items etc
    5. Basically I want to reformat my PC and when I reconnect my iPhon/e it will be the same as before.
    6. Are there certain files within the iTune folder that I need to vack-up
    Hope somebody can help, as im a novice with Itunes and Apple based softwear.
    Thank you in advance
    Bhav P

    Backup the library with this User Tip.
    Deauthorize the old computer as you no longer want to access protected content on it.
    Restore the backup to your new/rebuilt computer using the same tool used to back it up, ideally before installing iTunes.
    Keep your backup up-to-date in future.
    tt2

  • TS4036 I am trying to restore my phone using iTunes back up and iCloud back up. Both won't let me do it.  They said that it could not be completed.  What can I do to get my phone restored?

    I had to wipe my phone clean because of storage issues.  It kept saying I didn't have enough storage for pics or apps, but I only had about 75 pics and 1 extra app. So, I backed up my iPhone on icloud and itunes, then cleared off my iphone using the steps in the settings.  Then, when I am going back to restore my iPhone using iTunes back up and iCloud backup, it fails in both locations.  It says it failed to be completed. 
    What now?

    Thank you Terence for your help.  I was able to restore my backup from my time machine ext drive to a new 1tb seagate ext drive.  so i felt sort of ok.  but yesterday that older ext drive i used for time machine wouldn't open! i called applecare and they trouble shooted with me and said it's probably a goner and data is probably corrupted.  it's only a few years old and i'm very careful with it.  my husband accidentally dropped my new drive last night -- i know, unbelievable, i was SO upset, poor guy -- but I'm so stressed with all of this.  i have 10 years of photos and videos.  so now i only have the one newer drive with a backup.  i have to buy another one today to backup again so i at least have two backups.  i tried to delete a ton of files last night to free up the 30 gb of space i need to get my full library back on my mac. i have 90gb free and deleted 7 years worth of photos i had on picasa that were in my "pictures" folder and also a ton or random photos and videos i had in that same pictures folder and thought that would give me the 30 gb but it hardly freed up any space at all!  do you know why that is?  all of this stuff is really a pain and really stressful.  thank god i did have a backup in the first place but now i am panicked the one i have left will somehow crash.  especially after my husband dropped the drive lastnight! it didn't fall far and fell onto a wood floor and seems fine, but after my older ext drive crashed yesterday -- and i lost my entire iphoto library a fewweeks ago off my mac -- i feel cursed.  any answers you have would be great. thank you.

  • How do you remove back up data from the memory storage? my storage data states that i have over 80gb of data used for back ups and i dont know why as i use a external hard drive as a time machine .now my 250gb flash storage is nearly full

    how do you remove back up data from the memory storage? my storage data states that i have over 80gb of data used for back ups and i dont know why as i use a external hard drive as a time machine .now my 250gb flash storage is nearly full.. HELP!

    When Time Machine backs up a portable Mac, some of the free space will be used to make local snapshots, which are backup copies of recently deleted files. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown as  Backups. The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself. If you followed bad advice to disable local snapshots by running a shell command, you may have ended up with a lot of data in the Other category. Ask for instructions in that case.
    See this support article for some simple ways to free up storage space.

  • Why when I use the back button I have the same web site repeated many times in the history?

    If I am on ATT home page and open another tab and later use back button to go back to ATT page there are multiple ATT addresses. Maybe 5 or 10. This page was just used as an example.

    In Firefox 23 versions and later the keyword.URL pref is no longer supported and it is no longer possible to specify the search engine for the location bar via the keyword.URL pref.<br />
    The search engine that is used on the location bar and on the about:home page is the search engine that is selected in the search Bar on the Navigation Toolbar.<br />
    Current Firefox versions do not update the about:home home page until you refresh the page (future versions will do this automatically without a refresh) and that is what happens if you use the Back key.
    You can install the Keyword Search extension to specify with search engine to use for the location bar and which search engine to use for the about:home page via the Options/Preferences windows of this extension, accessible via the about:addons page.
    * Keyword Search: https://addons.mozilla.org/firefox/addon/keyword-search/

  • I've recently brought an iPhone 5c and I want to transfer all my pictures and phone numbers over from my old 4s without using iTunes how can I do this as there's already a iPhone synced to the laptop I would use to back it up

    Just need some help. As the question says I need to transfer all my numbers pictures videos onto my new iPhone 5c from my 4s but as the laptop I would use has already got my partners iPhone linked to it I can't back it up as it just syncs all there stuff onto it to. How else can I do this without linking it to the computer?

    What does the family WiFi have to do with iCloud? iCloud is on Apple's servers.
    If it is a shared computer what you can do is create a new user ID on the computer. Log in with the new ID. This will give you a "clean" iTunes library that you can use for backing up the the old phone and syncing the new phone.

  • HT1349 how can I change an email for authorization, the email address we used years back, is no longer a valid email address

    how can I change an email for authorization, the email address we used years back, is no longer a valid email address

    SfromW wrote: ... how can I change an email for authorization, the email address we used years back, is no longer a valid email address
    How to change account here: http://support.apple.com/kb/PH1641
    If you need more help, start here: http://www.apple.com/support/itunes/
    SfromW wrote: ... we can't remember the password from the old email address (for authorization)...
    Help Retrieving and changing passwords here: http://support.apple.com/kb/HT1911
    If you need more help, from iTunes for Windows, click  iTunes > iTunes Store > Support
    SfromW wrote: ... apple should make it easier to transfer authorization authority....I would think anyways.
    You might want to rethink your thoughts about making transferring authority easier.  Making it too easy would certainly degrade your account's security.  If you still believe it should be easier, you can send feedback directly to Apple via http://www.apple.com/feedback/itunesapp.html
    You will not get a response, but you can be certain that the responsible Apple people will see your input for consideration in FaceTime product development.
    As a new user, please understand that you are NOT directly addressing Apple here.  For more info about Apple discussions, start here: http://discussions.apple.com/static/apple/tutorial/etiquette.html 
    Message was edited by: EZ Jim
    Mac OSX 10.7.4

Maybe you are looking for

  • 3 user accounts on Mac with separate iTunes libraries

    I have 3 user accounts on a Mac with separate iTunes libraries.  Home sharing is turned on for all 3 and all use the same home sharing login Apple ID).  On both Apple TV 2's all 3 libraries appear under "computers", however, only one is accesible (al

  • Keywords PS CC - Number of photos applied to missing and can't search using keywords

    Last night in attempting to coordinate/consolidate the keywords assigned to 40k+ photos by over 4 programs the past 2 years I made an error. I had MANY photos with keywords Other/Statuary and I wanted to remove the Other part of the hierarchy and jus

  • How to get the best colour representation on screen

    Hi there, I am trying to get my LCD to most accurately represent colours from my Pantone swatch book. I have a Huey Pro calibration tool to assist in the LCD calibration. So, I've calibrated the display as best as I could. It's not a top of the line

  • Problem deploying an ear

    HI all, I am trying to deploy a JBoss Seam demo on the server using the command line tool and the deployment fails. The trace says: #1.5 #C000C0A83E3500010000000300961DFFFFFFFFFFFFFFFFFF#1174439328000#com.sap.engine.deployment.proxy.dc.DeploymentProx

  • Can I buy something from a certain store over the phone?

    Say there is a deal on tomorrow with the 5s, can I ring up my local store and pay over the phone? Or can I reserve it....