Calling a method for application scope

I have a method that initializes a hashtable.
That method should be called once when my web app starts, I need to load that hashtable into memory so whenever a user needs a value from that hashtable, it readily access the hashtable and doesn't load it everytime it is called. How do I do that?

Just put it in the application scope in the faces-config.xml?

Similar Messages

  • Is that a good practice to use syncronize methods for application scope cls

    Is that a good practice to use synchronize method in a application scope class, so I have a doubt, there a is class A, it has application scope and it contains a synchronized method add, so because of some network traffic or any unexpected exception client1 got stuck in the method, will that add method available for any other client...?
    Edited by: navaneeth.j on Dec 17, 2009 4:02 AM
    Edited by: navaneeth.j on Dec 17, 2009 4:04 AM

    If it needs synchronization, then it probably doesn't belong in the application scope. Either keep it as is, or reconsider the scope, or make it static.

  • How is call web method in application?.

    Hi,
    I have created java web application(Web Service).
    I want to call the setName() method in java application(GUI).
    how is call web method in application?.
    package sv;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    @WebService()
    public class MyService {
    @WebMethod(operationName = "setName")
    public String setName(@WebParam(name = "name")
    String name) {
    return "my string is "+ name;
    }

    The model layer should never depend on a specific view layer - this breaks reusability.
    What you need to do is expose a service method on your AM. Then your view can call this method and pass a parameter into the model layer.

  • Call VO method from application module

    Hi Experts.
    In my case I have created VO and inside implementation class custom method: filterResultsByGroup()
    code:
    public class VO_Business_AreaImpl extends ViewObjectImpl implements VO_Business_Area {
    public VO_Business_AreaImpl() {
    public void filterResultsByGroup() {
    System.out.println("hello");
    now... I would like to call filterResultsByGroup() method from Application Module Imp class:
    code:
    public class AppModuleImpl extends ApplicationModuleImpl implements AppModule {
    public AppModuleImpl() {
    public VO_Business_AreaImpl getVO_Business_Area1() {
    return (VO_Business_AreaImpl)findViewObject("VO_Business_Area1");
    public void RunGroupFilter(){
    ViewObjectImpl bussinesArea;
    bussinesArea = this.getVO_Business_Area1();
    ViewCriteria vc = bussinesArea.getViewCriteria("filterResultsByGroup();");
    bussinesArea.applyViewCriteria(vc);
    bussinesArea.executeQuery();
    but it doesn't work. Anyone knows how to call this method?
    Best Regards.

    you code should be like
    VO_Business_AreaImpl bussinesArea;
    bussinesArea = this.getVO_Business_Area1();
    bussinesArea.filterResultsByGroup();

  • Generic approach to call a method for any business object

    My requirement is to call the DISPLAY method of a business object when I have the objectType and objectId.
    Say I have BUS2012 and Id 4500001111, now I want to call a method which invoke the DISPLAY method for this object with objectId (say ME_DISPLAY_PURCHASE_DOCUMENT for purchase order). I even have the key fields for the business object.
    Is it possible ?
    Thanks in advance !
    Ruhi Hira

    Hi Ruhi,
               Yes you can call the method for display.Before we can do that we need to fix the procedure for the calling of the method.If you want to call it programitically or you want to call it in task builder or you want to use it as a activity in the work item.we can check for the BUSXXXXXX what ever number is there and we can also check for the activity type pre defined by SAP for it.If suppose you dont have the activity we can create the method for the BOR object type using SWO1.May be it helps your query.
    Have a best day ahead.

  • 500 INternal server error on making ajax call to method of Application page

    HI
    I have a application page that have a method in code behond ..i need to call this method on usercontrol using jquey on client side..when i ma makeing the call to method using $.Ajax({definiotion});
    then it gives me error 500 internal server error and this is coming only with the case when i am passing parameter to method usig javascript var object
    help me out on this... if required i wll upload the code also..
    regards
    Piyush
    piyush mishra

    This forum is for customization and programming of Microsoft Project - the project management scheduling product. 
    A quick search turned up:
    https://forum.jquery.com/
    I'd try there.

  • Calling a method for various files

    I am having a method with 500 lines.
    I need to call the same method for more than 50 files.
    How do I call the method.

    I would love to help you.
    But I'm SO confused.
    Can you try to be more specific?

  • No batch input data for screen  occured in Call Transaction method for PA40

    Hi,
    I creatred an interface to update an employee action data ( Change of position )  PA40 by using  Call transaction method.
    while executing the  interface, I got the below error.
    No batch input data for screen MP049100 200 
    this interface updated the first employee from file,  then after it is giving the below error frequently.
    No batch input data for screen MP049100 200
    regards,
    Ashok Reddy Revoori

    The infogroup of action Change Position may be having infotype 0491. The infotypes screen sequence is decided based on employee's country grouping and user group. For the employee where you are receiving error, infotype 0491 screen is appearing for which you do not have BDC data.

  • Call transaction method for MM42

    Hi Guis,
    I am using MM42 tcode  to Maintain  the article  Sales Orgnisation wise . For this I am using Call transaction method.
    Program is working fine in Display mode when I excute it in No display mode for some Sales Org I am getting message that
    'SOME OF THE GROUP DATA HAS BEEN BLOCKED BY ABAPER(My id) '  .
    I tried using diffrent recording  ways but the problem is not solving .
    Will you please any body solve my problem .
    Thanks,
    Santhosh.V

    HI,
    Check in SM12 and see fi there are any locks with ur id.close all the internal sessions and refresh the lock list..
    Now try again and see. Hope your id is not shared
    Regards,
    Nagaraj

  • How can I call a method for all instances of a certain class?

    Hi,
    I have created a snake java applet, which you can play here [http://users.telenet.be/javagames/|http://users.telenet.be/javagames/].
    But now I want to make this into a multi-player game (with two or more snakes etc..).
    In my main class you can find methods like these:
    snake.move();
    snake.drawSnake();Now if I just alter my main class and make a second instance of the class snake and change my methods to this,
    snake.move();
    snake2.move();
    snake.drawSnake();
    snake2.drawSnake();my game almost works perfectly, I'll have to make some minor changes though.
    But my question is, is there a better way of doing this. Instead of duplicating all the code, how can I make the methods immediately work for both snakes, instead of calling it twice?
    All suggestions are welcome!
    Thanks in advance.
    Lennart

    If there was something common to all snake instances then you could declare that variable static.
    Note: I don't want to confuse you here. A static variable can have a value apart from any instances at all. Instances can view static variables but a static method or inner class, for example, cannot view instance variables.
    More generally, I would think you would want to treat each snake as an automaton with its own behavior. There must be some class such as Game or Board or whatever that has, as suggested, either an array or collection of snakes. Iterate over each snake, ask it to perform some computation for the game and then draw itself.
    - Saish

  • Calling init() method from "session scope" backing beans (AbstractPageBean)

    hi,
    i prepared a jsp/jsf page named DBmanage, its backing bean's scope is set to "session"
    the page contains - among other components - one radiobuttongroup, the buttons of which i would like to rename at the first time when the user visits the page... (default names are "item 1", "item 2", "item 3")
    i thought that the overridden init() method does the work for me with this simple code:
    import com.sun.webui.jsf.model.Option
    @override
    init() {
    rbg_default_options.setOption( new Option[]{new Option("it1", "RB1"), new Option("it2", "RB2")}
    so, let see how this code works when DBmanage backing bean's scope is "request"
    great! i see a radiobuttongroup with two buttons, named RB1 and RB2
    ok, now i change the scope to "session"
    sh&#@t!!! now i'm gazing at a page with buttons named "item 1", "item 2", "item 3"
    let's place a breakpoint inside the init() method and DEBUG... and my init() code has not run(??), how can this happen? init() method is valid only for request beans?
    pls! could anyone help me?
    ps.: i work with netbeans6.0 & glassfish
    thanks
    Gabor

    it's ok. i found out why it wasn't working.
    my scope was set to "session", but had to be "request" so that i could use the params syntax.
    thanks anyway.

  • Sound and micro off during calls but not for applications

    People can't hear me, i can very hardly hear them, the update to 5.0.1 did not change anything

    Hey googlymoogly66,
    Thanks for using Apple Support Communities.
    Sounds like the sound works sometimes and then stops. So since it only affects some application and not everything it may be a software issue.
    iPhone: No sound or distorted sound from speaker
    http://support.apple.com/kb/ts5180
    Use iTunes to restore your iOS device to factory settings
    http://support.apple.com/kb/HT1414
    Have a nice day,
    Mario

  • Backup method for Application Servers in 11i

    Hi :
    EBS version: 11.5.10.CU2 - Linux 86
    I am planning to do an upgrade on the production system and wanted to take a complete backup of the EBS Environment. In the past I have always done a online backup of the application servers. I was wondering if there is any drawback in doing this. Can any one confirm if this is the correct method and if not why a cold backup is preferred?
    Regards,
    Bala

    I was wondering if there is any drawback in doing thisAs long as the backup is taken successfully and you are able to test this backup with no issues then you should be OK.
    Can any one confirm if this is the correct method and if not why a cold backup is preferred?Cold backup is preferred because is more consistent. If you can afford downtime go with the cold backup, otherwise the online backup is your only option (make sure you test the backup and have a good backup/restore strategy).
    Thanks,
    Hussein

  • Main method for application

    hello everyone,
    im new ADF mobile app on jDev. Ive started just a week ago. I have classes under ViewController and some methods include database querys.
    the exact question to ask u guyz, hom am i going use that methods, i mean which class,i will create i guess, i m soppose to use.
    In may amx page, i have selectOneChoice comp.. I create daha controls of course. but, Where am i going to create an object and populate it. Where am i going to use Listeners ?? 

    Hi,
    what about starting with a tutorial?http://docs.oracle.com/cd/E18941_01/tutorials/buildmobileappscontent/adfmobiletutorial_1.html
    This will answer all your questions at once. Please do this hands on first before you move on to ...
    https://blogs.oracle.com/shay/entry/developing_with_oracle_adf_mobile
    https://blogs.oracle.com/shay/entry/adf_mobile_update_through_web
    Frank

  • JWS Lifecycle/Scope (Axis "Application Scope" Behavior in WebLogic?)

    Apache Axis supports three different scopes for web services (Application, Request, Session). The documentation for Application scope says the following:
    <p>
    <i>"Application scope means there will only be a single instance of the service class for the entire AxisEngine. This means that that you, the developer of the service class must make sure all your methods are thread safe. ... Any state you keep in your service object will be shared across all invocations for the lifetime of the engine."</i>
    <p>
    How can I achieve the same behavior with a JWS service developed under WebLogic. ...a singleton web service accessed by multiple clients that maintains a shared state for the lifetime of the WebLogic server.
    <p>
    Thanks in advance,<br>
    Troy

    Apache Axis supports three different scopes for web services (Application, Request, Session). The documentation for Application scope says the following:
    <p>
    <i>"Application scope means there will only be a single instance of the service class for the entire AxisEngine. This means that that you, the developer of the service class must make sure all your methods are thread safe. ... Any state you keep in your service object will be shared across all invocations for the lifetime of the engine."</i>
    <p>
    How can I achieve the same behavior with a JWS service developed under WebLogic. ...a singleton web service accessed by multiple clients that maintains a shared state for the lifetime of the WebLogic server.
    <p>
    Thanks in advance,<br>
    Troy

Maybe you are looking for

  • GR amount is not matching with PO unit price

    Hi folks, I have created a Purchase Ordre in foreign currency euro with account assignment project. Say the unit price of the item is euro 500/pc. While doing GR for three pcs, it is showing in purchase order history only 9 euros and in local currenc

  • How can I see birthdays in iCloud calendar on PC

    Hello I recently have been converting over to iCloud for my contacts and calendar and using Outlook on PC. I understand the online version of iCloud calendar can include a 'birthdays' calendar which sources the data from iCloud contacts. However when

  • Painfully slow access to admin console (how can I fix it?)

    Hi, I'm using using Sun Java System Web Server Version 7.0U4 B12/02/2008 02:17 running on CentOS (Redhat EL) release 4.4. The problem is that using the Admin Console (on port 8989) is painfully slow. It takes minutes for each page to load, but they d

  • A simple question about Drag and Relate navigation

    Dear experts I have found SAP help or related manuals only good at talking difficult things such as how to customise the drag and relate targets, etc.  However, after I followed exactly and then how to test. Then I just see pieces of information, ver

  • EA3:  Open .sql file in current connection?

    I just upgraded from SQL Developer 1.2 to 1.5 EA3 and love the new Files tab in the navigator since I have tons of .sql files out on my local hard drive. The only inconvenience I have opening and running one of these SQL statements is that I must res