How to execute a logic in backing before page is loaded?

Hi guys,
I need to exeute a login in backing bean before the page is load. For instance, when user goto
http://forums.java.sun.com/thread.jsp?forum=427&thread=563631
the page will
<% request.setAttribute("forumid",request.getParameter("forum")) %>
<% request.setAttribute("threadid",request.getParameter("thread")) %>
<% --- Call backing bean logic here --%>
then the backing bean will be like
public class ThreadBean {
public String retrieveThreadData(){
FacesContext context = FacesContext.getCurrentInstance();
String threadid = context.getExternalContext().getRequestParameterMap().get("threadid");
String forumid = context.getExternalContext().getRequestParameterMap().get("forumid");
getThreafData(threadid, forumid);
return "success";
Hence, the page will be able to display all the data by the thread id. Appreciate any comment or example, Thank you !!
regards,
kmthien

U may need to check like
FacesContext.getCurrentInstance().getExternalContext().getRequestServletPath().equals("blah.jsp");
in the beginning of the function if it's the intend URL who call this function. This function will call several time if u don't check ServletPath.

Similar Messages

  • How to execute the logical database.

    how to execute the logical database.

    There are two ways of using a logical database - either by linking it with the executable program(specify the LDB name in the program attributes) or by using the function module LDB_PROCESS.
    1.Data read by the logical database is passed back to the program using the interface work areas.Use GET statements in the report.
    GET events are implemented internally as FORM routines.
    2.If you call the logical database using the above function module, the selection screen of LDB is not displayed.It uses special subroutines called callback routines, which are called by the function module and filled with the required data.
    Please refer the following link for more details.
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm

  • How do I stop Logic Pro X from trying to load a 32 bit plug-in that's no longer installed

    How do I stop Logic Pro X from trying to load a 32 bit plug-in that's no longer installed?  I noticed it occurring on projects where I used Miroslav Philharmonik. I keep getting prompted when opening the projects. I uninstalled Miroslav thinking it would stop, but it didn't.

    Assuming you are talking about the boxed set of Logic Studio (Logic Pro 9) on DVDs the only solutions are to either borrow or purchase an external CD/DVD drive and use that with your new MBP.
    Amazon sells a very reasonably priced 'Amazon Basics' external CD/DVD drive suitable for the process...
    http://www.amazon.com/AmazonBasics-Portable-External-Optical-Drive/dp/B003M0NT1M /ref=sr_1_1?ie=UTF8&qid=1416924310&sr=8-1&keywords=CD+DVD+external+drive+amazon+ basics
    Do NOT try and copy Logic across from your Mac to your MBP using something like Time Machine or Migration Assistant... 99% of the time, doing so results in all kind of weird issues later on.
    Just install Logic pro 9 plus all it's content from scratch using the DVDs provided with Logic Studio Boxed set.....

  • How do I get a file back that Pages (on iPad) automatically deleted?

    I was working on a file in the iPad Pages app, collapsed it to see all my documents in the program, then left Pages to check the 'net for a second, and when I returned to the Pages documents screen, the file thumbnail was not the usual microscopic text image of the file, but the Pages logo, and I was unable to access it when I tapped on it.
    No reason was given.
    So I restarted my Ipad (was this bad?), and when I went back in Pages, the file was there on the doucments screen with the Pages logo for only a second before it disappeared or was deleted.
    Boo-urns. Can I get back? A data recovery sort of thing?
    I back up my ipad regularly with my macbook via iTunes. Can I find an older version of it on my macbook somehow?
    Thanks for any assitance you can offer.

    If your have backed up your iPad to iCloud or your computer you can recover the file otherwise you may be out of luck. Did you you have iCloud backup turned on?

  • How to execute code written in java before javascript?

    Hello,
    is there any way to call the action or actionlistener method of a commandbutton (for instance, or any other component), before javascript is executed? (jsf 1.2_09, glassfish v2.1)
    Eg: I want to open a new window with javascript for the details/editing of a row in a data table. To do so I use a request scoped backing bean for the new window, and in its constructor I pass the rowdata through the session map where I put the object beforehand using an actionlistener/action.
    But this won't work, because the script happens before I can put the variable in the session map...
    Is there an other way?
    thanks
    david

    only thing I can come up with is to submit the data using Ajax. So do an Ajax call (for example using JQuery) to submit an asynchronous request to some servlet that will put the data in the session bean, then when the Ajax call finishes open the window.

  • How to make 'Cancel' button go back to page before

    Hello,
    In Oracle Sales module there a lot of pages e.g. Customer, Oppty and Lead Histories etc. Where button 'Cancel' is used. I need to create one on custom page.
    The custom page is called from update contact page and 'Cancel' button should return user back to 'update contact' page. I copied/pasted oracle code but then my 'Cancel' button returning me to Sales Dashboard page not update contact.
    My page's controller when 'Cancel' is clicked executes:
    processTargetURL(oapagecontext, null, null);
    Could you please tell me how can i get Cancel button work properly?
    thanks a lot

    Hi,
    I am not sure, but are you looking for passing information through destination URL. In the case of a 'button' (not Submitbutton), you can set the destination URL like "OA.jsp?OAFunc=<func_name>&Parameter1={@value}"
    Also if you use setForwardURL, then you can pass parameters in a Hashmap. See the syntax of Hashmap.
    public void setForwardURL(String url,
    String functionName,
    byte menuContextAction,
    String menuName,
    com.sun.java.util.collections.HashMap parameters, //note this
    boolean retainAM,
    String addBreadCrumb,
    byte messagingLevel)
    This way your requirement to send multiple parameters together can be addressed.
    Hope that helps.
    Thanks

  • How to execute Script logic file

    Hi,
    I want to execute a "stand alone" scipt logic file only once. Simply spoken, the script should write some members from application A to application B (I would set the scope for the members that are concerned in the script itself) once. Is there a way to do this? If possible, I would like to get around customizing the DTS packages or use them in a simple way (e.g. can I simply say sth like package==mylogicfile.lgf), without learning all the DTS syntax...

    Hi,
    There isn't much syntax to learn to get it to run really. Just copy the ICElim package and replace the ICElim.lgx with your own lgf/lgx file.
    And if you are only going to do this once, why don't you just write a piece of SQL to do the copy across?
    Regards,
    Andires

  • Hi, I'm planning on using Mainstage 3 for performing live and I wanted to know how to add my Logic Pro backing tracks into it and have automated vocal effects that trigger while I'm singing.  How do I do this?

    I have a mic hooked up through an interface and I'd like to open up my backing tracks then figure out what vocal effect sound good on what places during the song, then I want to have those automatically trigger while I'm singing and performing.  Any help or suggestions would be much appreciated.  Thanks.

    Here’s a couple of links to get you started on your research...
    OS X Lion Overview
    iLife 11
    http://www.apple.com/ilife/video-showcase/
    http://www.apple.com/ilife/
    Running Windows on a Mac
    http://www.pcmag.com/article2/0,2817,2344661,00.asp
    And just in case you didn't know... This is a User to User Forum

  • JDev 11.1.2.1 Execute method (with bind variable) before page is displayed

    Hi All,
    I have a view object with a query that uses a bind variable. I drag the data control onto my .jsf page to create a table. I create a query method on a view scope bean. The query method uses the contents of one of the bean's attributes to set the bind variable for the query:
    vo.setNamedWhereClauseParam("CraIdBindVar", sessionBean.getCraId());
    I place a button on the page that invokes the query method and it populates the table. This is fine but I don't want the user to have to click on the 'query' button when they navigate to this page. I have found forums that discuss creating an AMImpl.jave method, creating a binding on the page, creating an executable for the binding. This works in that the method is executed before the page is displayed. However, the AMImpl method cannot call sessionBean.getCraid() to get the necessary data item to populate the bind variable.
    Is there a way to execute my view scope bean method before the page is displayed? Or perhaps a way for the AMImpl.java method to access the view scope variable?
    Thanks, Steve

    Steve,
    you can drag a method call activity onto the task flow. Then select the new method call activity and open the property inspector. Here you select the method from your bean in the method property. Now you first navigate to this method call activity and then to the page.
    Timo

  • How do you get the toolbar back on pages iOS

    The toolbar at the top of screen which quickly enables you to change font ect. Has gone and I don't know how to get it back.  I clicked the cross at the right of toolbar and it went.  Any idea how to get it back?

    This information is in the online help file that you can get to through the Wrench icon. Same is online here:
    http://help.apple.com/pages/ipad/1.7/#tan72487ce9
    Just tap the "Hide or show ruler" header.
    Jason

  • How big can a word document be before Pages (iPad1) crashes?

    I have an iPad1 and was thinking of using it for some quick edits. Since my MacBook struggles a bit with some of my larger word documents, I wondered how the iPad would fare. I don't want to waste the $10 on Pages if it isn't going to work for me. My documents tend to be 100-400 pages, with TOC's, indices, tables, and figures spread through out. The file sizes (of .doc and .docx files) range from 2MB-12MB. Is the idea of editing these documents on an iPad just a dream?

    There is no fixed limit on what Pages for iPad can handle and 2-15 MB is doable.
    That said, 100-400 pages is not a "consumer" level document.  Thats a very large document.  If Word on a full blown computer is having issues with your documents then Pages on a Mobile device may struggle.
    Pages may run slowly with that number of pages and complexity you indicate.  Embeded graphics take more of a tole than simple text.  In addition it may not preserve some of the unique formatting you might have from Word.
    It might be wise to take an example document to an Apple Retail store or Best Buy and load it on one of their iPads and see what it does.
    Cheers.

  • How to install my ipod shuffle back and get down loads

    how to install ipod shuffle

    Are you shure this is an ipod shuffle, because the ipod shuffle dsent have a screen. If it is shuffle  down load itunes on your computer, plug the headphone/usb that came with it into the ipods headphone port. Then connect the ipod into your computer and i tunes should recagnize it and walk you through every thing elese.

  • How do I stop the "Mozilla Firefox Start Page" from loading everytime I start Firefox? My home page is opening AND the (totally useless) 'start page'.

    Just installed Firefox on my second Windows machine (running XP Home). Unlike my other installation, every time I start Firefox I get TWO tabs - my home page AND a "Mozilla Firefox Start Page" that contains only a Google search input. I don't need the useless start page, but haven't found anything that tells me how to stop it from loading.

    Try This works good for those who aren't computer tech savvy like me
    Type about:config in the address bar
    Click I'll be careful, I promise if prompted
    In the Filter input field type startup
    Double click on startup.homepage_override_url
    Delete the text string and click OK
    Close Firefox and reopen the window to verify that it has worked.
    Hopefully this helps!
    I just tried this myself and it totally worked for me Good Luck

  • How to reset the data scroller to fist page, on load of the page.

    Hello,
    My requirements is to reset the datascroller to first in popup.
    In popup page contains datatable and Save and Cancel button. Data SCroller functionality is implemeted for data table. Setting data scroller to first page is done for both Save and Cancel functionalities. And its working fine.
    I'm facing problem when user navigates to next ot last option (i e other than first), and closes the popup using window close, and again try to open the popup, datascroller retains previous value.
    So i wanna to set data scroller onload of the page , how to get the dataScroller compaonent in constructor with out Action Event. or any other alternative exists to reset datascroller to first.
    Need help

    Hey, I got a doubt that who will call the print method in the same program and what about the g.drawString() it is showing any output effect. Finally how the variable n will get initializing to 0 and 1 for two times respectively. Can u please elaborate on this...

  • How do I disable Firefox Faster - where subsequent pages automatically load when scrolling down the page?

    When I am on the website "PlentyofFish.com" and scroll down to the end of the page, the subsequent pages begin to load up and "stack up" which conceals the previous pages and contacts. This does not normally cause a problem with other websites, like news sites, where I can read from page to page without having to find the "page forward" button.

    This should be in the same spot:
    "3-bar" menu button (or Tools menu) > Options > Advanced > General mini-tab > ''uncheck the box for'' "Warn me when websites try to redirect or reload the page"

Maybe you are looking for