How to focus this?

Hi.
Let's say I have a form connected to a bean.
it could be like this:
public class MyBean {
String name, age, surname, address;
public MyBean() {
//Make query to database to extract name, age, surname, address     
private void init() {
//Another place to make query to database to extract name, age, surname, address     
//Getters and Setters for the form
public String getName() {
          return name;
public void setName(String name) {
          this.name = name;
In my page (my Form) I use the bean (MyBean ) like this, to show my the data:
<h:outputText value="#{myBean.name}" />
<h:outputText value="#{myBean.age}" />
<h:outputText value="#{myBean.surname}" />
<h:outputText value="#{myBean.address}" />
IMPORTANT:
Application is in session scope and MyBean too.
This bean will retrieve data from SEVERAL databases.
I'm trying to re-using the same composition of the form for several querys to differents database-datatables, but with the same fields (name, age, surname, address)
I have an initial page, with, let's say 4 links. All links use the same form, but depending on what link is selected I will pass parameters to make a differents query.
Link for database 1 --> Show the form, but retrieving data from database 1 (The first time is ok, because the bean is created)
Link for database 2 --> Show the form, but retrieving data from database 2 (How can I do to re-query again the database)
Link for database 3 --> Show the form, but retrieving data from database 3
Link for database 4 --> Show the form, but retrieving data from database 4
PROBLEM:
First time I need the bean, this bean is created in the constructor or in a method called by the constructor (init method, for instance). The following times this method is no longer called because the bean is created and always I have the result of the first time I called
How can I focus this stuff to force to requery the database every time I need it. Is there some mechanism to controll this.
Any help??
Thanks

Hi, nirvan
so, the idea is create a method which will be fired always, everytime I select one of the link no matter if the bean is created or not?, I like it.
Thanks.
PD:
balusc, why it must be done using request scope and not session???. The bean is created the first time and I can use my pages with this bean, just changing the data from database until the browser is closed or a session time out?.. Am I wrong??

Similar Messages

  • How to fix this

    I want to get rid of that small border on the right and below the right column
    here is the code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <style type="text/css">
    <!--
    body {
              font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
              background: #4E5869;
              margin: 0;
              padding: 0;
              color: #000;
    /* ~~ Element/tag selectors ~~ */
    ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
              padding: 0;
              margin: 0;
    h1, h2, h3, h4, h5, h6, p {
              margin-top: 0;           /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
              padding-right: 15px;
              padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
    a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
              border: none;
    /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
    a:link {
              color:#414958;
              text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
    a:visited {
              color: #4E5869;
              text-decoration: underline;
    a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
              text-decoration: none;
    /* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */
    .container {
              width: 80%;
              max-width: 1260px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */
              min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */
              background: #FFF;
              margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */
    /* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */
    .header {
              background: #6F7D94;
              font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
              font-size: 36px;
              font-weight: bolder;
              alignment-adjust: middle;
              alignment-baseline: middle;
              padding-left: 11px;
    /* ~~ These are the columns for the layout. ~~
    1) Padding is only placed on the top and/or bottom of the divs. The elements within these divs have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.
    2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a right margin on a div set to float right). Many times, padding can be used instead. For divs where this rule must be broken, you should add a "display:inline" declaration to the div's rule to tame a bug where some versions of Internet Explorer double the margin.
    3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar divs could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document.
    4) If you prefer your nav on the right instead of the left, simply float these columns the opposite direction (all right instead of all left) and they'll render in reverse order. There's no need to move the divs around in the HTML source.
    .sidebar1 {
              float: left;
              width: 20%;
              background: #93A5C4;
              padding-bottom: 10px;
    .content {
              padding: 10px 0;
              width: 60%;
              float: left;
    .sidebar2 {
              float: left;
              width: 20%;
              background: #93A5C4;
              padding: 10px 0;
    /* ~~ This grouped selector gives the lists in the .content area space ~~ */
    .content ul, .content ol {
              padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
    /* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */
    ul.nav {
              list-style: none; /* this removes the list marker */
              border-top: 1px solid #666; /* this creates the top border for the links - all others are placed using a bottom border on the LI */
              margin-bottom: 15px; /* this creates the space between the navigation on the content below */
    ul.nav li {
              border-bottom: 1px solid #666; /* this creates the button separation */
    ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */
              padding: 5px 5px 5px 15px;
              display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */
              text-decoration: none;
              background: #8090AB;
              color: #000;
    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */
              background: #6F7D94;
              color: #FFF;
    /* ~~The footer ~~ */
    .footer {
              padding: 10px 0;
              background: #6F7D94;
              position: relative;/* this gives IE6 hasLayout to properly clear */
              clear: both; /* this clear property forces the .container to understand where the columns end and contain them */
    /* ~~miscellaneous float/clear classes~~ */
    .fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
              float: right;
              margin-left: 8px;
    .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
              float: left;
              margin-right: 8px;
    .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
              clear:both;
              height:0;
              font-size: 1px;
              line-height: 0px;
    -->
    </style><!--[if lte IE 7]>
    <style>
    .content { margin-right: -1px; } /* this 1px negative margin can be placed on any of the columns in this layout with the same corrective effect. */
    ul.nav a { zoom: 1; }  /* the zoom property gives IE the hasLayout trigger it needs to correct extra whiltespace between the links */
    </style>
    <![endif]-->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    </head>
    <body>
    <div class="container">
      <div class="header"><!-- end .header --> Good Questions Have Groups Talking</div>
      <div class="sidebar1">
        <ul class="nav">
          <li><a href="http://www.joshhunt.com">Home</a></li>
          <li><a href="../schedule.htm">Conferences</a></li>
          <li><a href="../sunday-school.htm">Lessons</a></li>
          <li><a href="../contact.htm">About</a></li>
        </ul>
        <p>A group of 10 that doubles every 18 months will reach 1000 people for God in 10 years.<!-- end .sidebar1 --></p>
      </div>
      <div class="content"><!-- TemplateBeginEditable name="EditRegion3" -->
        <h1> </h1>
        <p> </p>
        <p> </p>
      <!-- TemplateEndEditable --><!-- end .content --></div>
      <div class="sidebar2">
        <h4>How to double a group</h4>
        <p>You can double a class in two years or less by inviting every member and every prospect to every fellowship every month.</p>
      </div>
      <div class="footer">
        <p align="center">Josh Hunt &#8226; [email protected] &#8226;  www.joshhunt.com &#8226;  575.650.4564</p>
        <!-- end .footer --></div>
      <!-- end .container --></div>
    </body>
    </html>

    Equal height CSS columns:
    http://alt-web.com/Articles/Equal-Height-CSS-Columns.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • I am using a MacBook Pro and am trying to print double sided copies on the HP Deskjet 3054 that came with it. Can anyone tell me how to do this?

    I am using a MacBook Pro and am trying to print double sided copies on the HP Deskjet 3054 that came with it. Can anyone tell me how to do this? I am a total MacBook nube and can use any help you may offer! Thank you so much.

    How you enable double-sided printing can depend on the applications from whick you wish to print. Example: if I print to my HP PhotoSmart  from Safari, I get this print dialog box:
    (Edit: OOPS! Note that I forgot to switch printers when i took the scene-shots, so ignore the "Brother" reference. It's should look the same for your HP.
    Note the selection labled "Safari" near the bottom. If I change that form "safari to "Layout: I get this:
    Note the option for two-sided printing appears for your selection. If I print from Word, the box is different:
    The "Copies & Pages" option can be changed to "Layout" when you click it, again allowing the selection of two-sided printing.
    If you tell us what applciaiton is vexing you, we may be able to give better-focused information.
    A

  • In Mountain Lion a BDMV folder is always displayed a package, how to disable this "feature"

    For some video editing tools you need to have acess to the folderstructure during file->open.
    any idea how to do this ?
    Looking forward to your ideas

    This little trick does not involve renaming anything and should work in general for any files buried within packages that are dragged onto an Open File dialog. It might not work if the video editor has an unconventional GUI that doesn't use a standard Finder window for its Open/Import/Save operations.
    woodmeister50 was on the right track. In the video editor, choose File: Open or Import such that a dialog window opens. Then, in a separate Finder window, right-click on the BDMV and Show Package Contents. Navigate to the stream that you want to import. Drag and drop the M2TS from Finder onto the video editor's file browser window. The file won't be moved. Instead the open/import dialog will navigate to the directory containing the M2TS file.
    Another way is to do this is to enter CMD + SHIFT + G while an Open File dialog has focus. You can manually paste in the path to the package's contents.
    I don't know how to make Finder interpret certain package types as a standard folder structure. There's probably a way.

  • Ive lost my apple ID for my ipod, now i have an iphone and i want to use the same apple ID for both can someone tell me how to do this

    I have lost my apple ID for my ipod, now ive got a new iphone and i want to use the same ID for both, can anyone one tell me how to do this? ( i no my ID for the iphone)

    Just use the same ID.
    These may alos help:
    How to use multiple iPods, iPads, or iPhones with one computer
    What is the best way to manage multiple...: Apple Support Communities

  • I locked myself out of my ipod touch for 60 mins then actually typed the wrong password in again.  Now it is telling me to "connect to itunes".  I am unsure how to do this.  I am unable to use my ipod at all now. Please help.

    Hi,
    Due to my brother locking me out of my ipod touch I had to wait an hour to log in again.  Unfortunately when I did this, I, again put in the wrong password twice more, each time locking me out for a further 60 minutes.  On my 3rd attempt to log in the wrong password was entered again.  This time though instead of logging me out for another 60mins it now tells me to "connect to itunes" but I have no idea how to do this and I am now unable to use my ipod.  Please help.

    See Here  >  http://support.apple.com/kb/HT1212

  • I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem?

    Problem with an incoming message. For example, during my conversation the second line receives a call, I hear the sound in dynamics such as "piiiip piiiip," but when in this situation I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem? Perhaps someone tell me? save in advance

    Not Charge
    - See:     
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    - Try another cable. The cable for 5G iPod (lightning connector) seems to be more prone to failure than the older cable.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • Recently loaded Lion on my laptop and now my computer crashes often. Black screen and keyboard lights up. Any ideas on what's wrong and how to fix this?

    Recently loaded Lion on my laptop and now my computer crashes often. Black screen and keyboard lights up. Any ideas on what's wrong and how to fix this?

    Everytime this happens Ihave to power down and restart! Any ideas would be appreciated!

  • I bought an I pad 2 from us but I can not activate the Facetime in UAE(Dubai)as I can not see the country in the I pad's  drop list, anyone has an idea as how to resolve this issue

    I bought an I pad 2 from us but I can not activate the Facetime in UAE(Dubai)as I can not see the country in the I pad's  drop list, anyone has an idea as to how to resolve this issue

    I'm not that familiar with how FaceTime works. I know how to set It up but I don't use it. I just know that you can't activate in the UAE. I believe that you can activate in any country that permits it's use. Whether you will need a new ID or not, I can't confirm.
    You can Google this and get all sorts of articles on workarounds. Apparently if you set up a VPN you can use it in the UAE. Here is one article that I found.
    http://talkfree7.blogspot.com/2010/09/how-to-facetime-voip-call-from-uae.html
    I Googled "workaround for FaceTime in UAE" to find this.

  • After moving to iCloud I can only get my email through the cloud, no new emails are making it to my home computer. Does anyone have any advice on how to fix this issue?

    After moving to iCloud I can only get my email through the cloud, no new emails are making it to my home computer and .mac account. Does anyone have any advice on how to fix this issue?

    Welcome to the Apple Community.
    Which OS are you using.

  • My iPhone 4 no longer connects to my car or alarm clock after a recent sync to my computer.  The message at I get when trying to. Connect is "this accessory is not optimized for the device" or something like that.  Anyone know how to fix this?

    My iPhone 4 no longer connects to my car or alarm clock after a recent sync to my computer.  The message at I get when trying to. Connect is "this accessory is not optimized for the device" or something like that.  Anyone know how to fix this?

    Hello there philp_69,
    If I understand correctly it sounds like your phone hasnt been recognized in iTunes on your PC since the last couple of updates. I would use the troubleshooting in the following article which will walk you through the steps one by one. 
    iPhone, iPad, or iPod touch not recognized in iTunes for Windows
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • My new iPhone 4S can't connect to iTunes, App Store or iBooks via Wi-Fi. Works with 3G network. How to fix this?

    My new iPhone 4S (week old) can't connect to iTunes, App Store or iBooks via Wi-Fi (and some other apps e.g. Hollister – but most of the other apps like Safari or ebay work fine). There is no problem with those apps loading via 3G network. When I turn off the wi-fi, it runs over 3G and i can access App store without any problem. When i turn off the 3G network and turn the Wi-Fi on, those apps like App Store won't work, other apps work fine. When i turn on both Wi-Fi and 3G, the App store (and so on) is also not working, other apps are.
    I also found out that when the Wi-fi is on and I sign out my apple ID, the App store starts working! But when I log in again, it will imediatelly stop working. I've tried logging in with others apple IDs, still with the same result. There is no problem with my apple ID account, because it works on my iPad, even via Wi-Fi.
    When i first set up my iPhone, there were no complications using App store ia Wi-fi with exactly the same account. I don't know if it has anything to do with it, but this problem started when i logged in with my UK account and then wanted to log back in with my Czech account.
    I tried turning it off, hard reset and deleting my iPhone several time (even without back up). Nothing worked since then.
    Does anyone have any idea how to fix this?
    I would really appreciate ANY help. This porblem is driving me crazy!

    I am also having the same issue. Please help!

  • TS2755 Iphone 4s voice to text messaging has stopped working. Any information on how to correct this?

    Iphone 4s voice to text messaging suddenly stopped working. The little dots that appear while program is preparing to tranfer audio to text shake side to side and no text appear.

    Any ideas on how to fix this problem
    Depends on what the problem is.

  • When I open iTunes it will automatically go to full screen mode. I can't work out how to turn this off. Only iTunes opens to full screen mode.

    When I open iTunes it will automatically go to full screen mode. I can't work out how to turn this off. Only iTunes opens to full screen mode.

    Go to System Preferences (under the Apple logo in the menu bar).  Choose "General".  Click "Always close windows when quitting an application".
    That should fix it.

  • Having purchased and installed pages after finishing my 30 day trial I now can't save changes to documents, it keeps saying that my trial is over and I need a serial number?  Never got a serial number, any ideas how to rectify this?

    Hi, having purchased and installed pages after my 30 day trial had finished I am now unable to save any changes to documents I had created in the trial version.  It says I need a serial number, which I never got when I purchased the pages app.  Does anyone kno how to rectify this, I would be very grateful for any help as I'm currently writing up my thesis and am now unable

    Hi, I had the same problem and I found that you don't need a serial number anymore. Here is what I did:
    (1)I went to Applications fodder on my Mac. (You can navigate to the Application folder from 'New Finder Window.')
    (2) Deleted Pages (installed as part of the free  free trial version) from the Applications Folder. Also deleted 'IWorks' from the Applications folder.
    (3) Started AppStore.
    (4) Clicked on  Purchases.
    (5) Clicked on Pages.
    (6) Clicked Install.
    (4) repeated (5) and (6) for Numbers and Keynote

Maybe you are looking for

  • How can I re-org my Exchange folders on my iPhone?

    The Exchange mail client on the iPhone shows the Exchange folders as they are in Exchange.  Yesterday, out of the blue, I checked my mail and found that Sent Items and Drafts were at the top and I was thrilled, as this prevented me from having to scr

  • Emails wont send, staying in outbox. live.co.uk account

    my live.co.uk account outgoing server says offline. need help really annoying emails just stay in outbox

  • Second Display Question

    I am running the 23" Cinema Display (ATI X1900 card). I have an older Studio 17" display which I would like to use as a second display. Does the Apple DVI to ADC Display Adapter work for the Mac Pro?? Thanks!! Sky.....

  • JSP/Tomcat/MySQL

    Hello JSP developers! I have a problem trying to connect to MySQL database when I am doing a JSP or a servlet. I think the problem has to be with Tomcat, because when I do a java application with a database connection works perfectly, so there must b

  • How to upgrade Robohelp X5 to Robohelp 7 (or some later version)?

    (Searched the forum but didn't find an answer. I apologize if it has been covered already.) We've been using Robohelp X5 and are now considering an upgrade due to the incompatibility with current versions of MS Word. On Adobe's product page there see