Object scope: using application

Hi
I would like to know how a bean is stored in the servlet when u use application scope.
When using session it would be:
session.setAttribute("key", key1); In the JSP it would then be session.getAttribute("key");
how would this be done for application scope?

Hello. Same thing actually.
Do:
application.setAttribute("myInfo", myInfo)
and
MyInfoClass myInfo = (MyInfoClass)
application.getAttribute("myInfo");
As rhibiscus rightly stated, you can use the application implicit reference in a JSP. For a servlet, use the getServletContext() method to get a reference to the application scope.
e.g.
ServletContext context = getServletContext();
context.getAttribute("myInfo");

Similar Messages

  • How do I find out all the objects I use in my application.

    As I am creating my documentation, I realized it would be helpful to know all the objects that my application uses ( tables, views, packages etc). Is there a way to find that out i.e. any script or simple alternative etc ?
    Thanks, folks!

    I am on version 3.0.1.00.08 and am trying to figure this out for this version.The navigation path is different but the report is available somewhere.
    Also, is there a way to get the sql from all the pages out ?What do you mean?
    Scott

  • Import budget by using DTW, error message "cannot find this object in B1 application defined, object defined error 65171

    Dear Sirs, I try to import budget header and budget line by using DTW, however error message found, "Cannot find this object in B1 application defined, object defined error 65171. Regards, Saw Hua

    Hi Javier,
    Please check below links.
    DTW Error 65171
    DTW error 65171
    DTW, Unkonwn error 1005!65171
    DTW error 65171 - Cannot find this object
    DTW error65171
    SAP B1 Data Transfer WorkBench : Data too large... | SCN
    Hope this help
    Regards::::
    Atul Chakraborty

  • Using Application Scope Javabean to hold data?

    I have a set of (4000) records I would like to store in a Javabean to be used within mutiple JSPs. I am using JSP and Javabeans, no EJBs. My question is should I use Application scope for the Javabean to be shared for all the JSPs instead of a Sesstion scope to limit stress to the server? Thanks.

    I think use session scope. Application scope may tie up resources u might not need. That is my personal opinio though.

  • Help on create a object for an application using startup in wls 8.1

    hi guys
    i am trying to figure out a way to create a initial data object that can used by session beans in a ear deployed in weblogic 8.1. so far i figured out to extend ApplicationLifecycleListener and override the postStart() to instantiate the initial data object (will use JDBC to load data). but i can't figure out how to make this object apparent to other components in the ear. i.e. how can my session ejb access it? whatt is the strategy used here for thing like this? i really appreciate if any one can provide some help.

    hi guys
    i am trying to figure out a way to create a initial data object that can used by session beans in a ear deployed in weblogic 8.1. so far i figured out to extend ApplicationLifecycleListener and override the postStart() to instantiate the initial data object (will use JDBC to load data). but i can't figure out how to make this object apparent to other components in the ear. i.e. how can my session ejb access it? whatt is the strategy used here for thing like this? i really appreciate if any one can provide some help.

  • How to use application managed entity manager in EJB?

    I finish reading The EntityManager Interface in JEE tutorial.
    I know I can use container manager entity manager in EJB, but I want to explore how to use application managed entity manager in EJB.
    Can I use application managed entity manager in EJB (container management JTA transaction is used)? Where do I should close entity manager if can?
    The following is an example from JEE tutorial, but didn't find where to calose entity manager. and can I create mutiple EntityManagerFactory objects and Entity Manager objects to use them in a JTA transaction?
    @PersistenceUnit
    EntityManagerFactory emf;
    EntityManager em;
    @Resource
    UserTransaction utx;
    em = emf.createEntityManager();
    try {
      utx.begin();
      em.persist(SomeEntity);
      em.merge(AnotherEntity);
      em.remove(ThirdEntity);
      utx.commit();
    } catch (Exception e) {
      utx.rollback();

    Seems like a very poor example, the whole power of EJBs is to use Container Managed Transactions so you don't NEED to manage the transaction and the entity manager yourself. What you posted is code I would expect in a non-JEE application, or in a piece of code which requires fine-tuned transaction boundaries such as batched data importing logic.
    If I were you I'd research JPA in steps.
    a) learn about JPA as an API outside of the scope of EJBs (recommended reading: the book 'Pro JPA 2')
    b) learn about Container Managed Transactions in EJBs
    c) learn about Bean Managed Transactions in EJBs
    Right now you're rushing into c). I can understand that it raises many question marks at this point.

  • How to use application class reference in the controller methods of BSP

    Hi,
    I have created a bsp application and also created an application class and assigned it to the application class. In the application class, I have created attribute TEXT type string(public and instance parameter).
    In the controller let's say main.do, I am trying to give a value to to the text by adding the following code.
    application->text = 'test'.
    I am getting syntax error saying field 'text' is unknown. It is not contained in one of the specified tables nor defined by DATA statement. 
    Please can someone let me know how to use the application class in the coding with an example. I couldn't find how exactly this has to be reference. Please help.
    Best regards
    Siva

    Hi,
    if you are having main controller and sub-controller then you may need to use below coding to use application class reference.
    *Data declaration
      DATA:  obj_cntrl        TYPE REF TO cl_bsp_controller2,
             obj_sub_cntrl   TYPE REF TO z_cl_sub_cntl,
             application TYPE REF TO z_cl_application.
    *Get the controller
      CALL METHOD obj_main_cntrl->get_controller   "obj_main_cntrl is the object of main controller
        EXPORTING
          controller_id       = 'SUB'   "Controller ID
        RECEIVING
          controller_instance = obj_cntrl  .
      obj_sub_cntrl ?= obj_cntrl  .
      application ?= obj_sub_cntrl ->application.
    or simply use below code in your controller method.
      application ?= me->application.
    Thnaks,
    Chandra

  • Runtime error 429, activeX component cant create object while using netbet pro on windows 7 & 8.1 HELP!!!

    runtime error 429, activeX component cant create object while using netbet pro
    does anyone know what I could do to fix this problem??? netbet pro was't available for a while then it's back but has yet to run

    What's netbet pro?
    I'd recommend asking questions about third party applications in the vendor's forum, not a Microsoft forum meant for admin scripting.
    EDIT: Ah, some gambling website...
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • Generic Object Services using Web Dynpro

    I am using Web Dynpro for ABAP and would like to access Generic Object Services (GOS) to view attachments to an SAP Business Object.  Using the cl_gos* classes does not work when running WebDynpro as it uses the controls framework. 
    How can I access the functionality of GOS from a Web Dynpro application?
    Regards,
    Bob

    Hi,
    I assume that you wantted to have the attachements in a mail.
    Please check out the Adobe Forms(ie PDF attachements) and Office Control UI elements in WDA.
    Regards
    Lekha

  • Which to use application.cfm or application.cfc?

    Hi,
    Just a general question, i have been using application.cfm
    for my applications so far. I came across a tag that would be used
    under application.cfc, but i tried putting both templates together
    in one application and boom, an error showed up.
    So, which is better to use with most of the applications
    application.cfm or .cfc?
    Thanks for any help!
    Syed

    It's actually a bit easier to use session and application
    scope variables with Application.cfc, I think.
    Application.cfc has methods for specific "events" or states:
    onApplicationStart() -- where to load application variables,
    security logic, etc.
    onSessionStart() -- initialize session varialbes, etc.
    onRequestStart() -- runs at the start of each page request
    onRequestEnd()
    onSessionEnd()
    onApplicationEnd()
    onError() -- very nice place to get some good
    Application-wide error handling code in place
    onRequest() -- be sure to read the notes on this
    method...it's a bit different.
    Check out the MX7 reference page for Application.cfc:
    http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?cont ext=ColdFusion_Documentation&file=00000692.htm
    CF* (if you're using that yet)
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Part_3_CFML_Ref_1.html

  • Need a way to pass object to another application

    Hello Everyone,
    I need to pass an object from one application to another. I wanted to do that using request.setAttribute(Object) but this works only on RequestDispatcher.forward(URL) method and can be used only within the application you are currently in. It does not work for absolute URLs therefore I cannot go to another application. I also tried response.sendRedirect(URL) but then request object is lost when redirected to another application.
    Any help will be greatly appreciated,
    Thanks in advance,
    Y.M.

    if your two application servers are on the same box,
    then you can get the RequestDispatcher object from
    another ServletContext and then use the
    request.setAttribute() call.
    ServletContext newContext =
    getServletContext().getContext(webApp);
         if( newContext == null )
    throw new IllegalArgumentException("Invalid webApp
    p '"+webApp+"' does not exist.");
    request.setAttribute("myobject", objToPass) ;
    RequestDispatcher dispatcher =
    newContext.getRequestDispatcher(urlToGoTo) ;
    dispatcher.forward(request, response);
    Unfortunately those apps are on different servers ...

  • Is there a way to find which DB object is used in which all pages

    Hi All,
    Is there any way by which we can find out which All Database objects are used in which all pages in an Application. Our Application is quite big and has lots of pages, So is there any report like functionality where I can check the DB objects used on page basis or any underlying view where we can get this information.
    Thanks,
    Vikas

    Hello Vikas,
    There are a couple of APEX Views which provide you with that information.
    If you go to Home>Utilities>Application Express Views
    following views may be useful to you:
    - APEX_APPLICATION_PAGE_DB_ITEMS
    - APEX_APPLICATION_PAGE_PROC
    There are a couple of others (for ex if you make use of flash charts, interactive reports etc) but if you start with the above you'll have a good starting point.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • Business Object linked to application document

    hi All,
    Is there any standard tcode or way to find out a given business object is linked to what all application documents?
    Like for example i would like to know BO FIPP is linked or can be used for what all documents or tcodes??
    How can find out??
    Thanks in advance.
    Regards,
    Raj

    Hello Raj,
    this is indeed a sad thing, not having a control table that links transaction codes to objects or classes. The GOS-Integration (Generic Object Services) are implemented within each transaction and usually the business object types used there are hard coded.
    You can have a look at the where-used-list of ABAP class CL_GOS_MANAGER. You'll find an example here, include LMEORF1M at form routine  bus2053_object_publish.  There  you'll see the common way of how objects are used/published.
    Furthermore, the event creation/handling is also usually hard coded.
    Not all transactions that make use of business objects, also use the GOS. So you'll always get a part of this.
    You can also have a look at the where-used-list of Business Object Interface IFGOS.
    Best wishes
       Florin

  • Flashbuilder and Cold Fusion  (using application/session variables)

    I would like to know if anybody uses Flashbuilder with Cold Fusion?
    Since Cold Fusion has lots of different scopes of variables (application, session, client, form, url, etc...) how do you manage this in Flex/Flashbuilder?
    Are there forums or groups specifically for using Flex3/Flashbuilder with backend server side technologies such as Cold Fusion?.
    The only server side technology that I have interest in is Cold Fusion.  I've seen basic tutorials and videos using Cold Fusion CFC's and data binding with Flex.  I haven't seen or heard anything using a Cold Fusion application, session, or client variable in Flex.
    Hopefully some of you have some experience on this topic.
    Thanks

    hey popster,
    i too had this question some time ago. my entire app was built on CF with HTML before i started integrating Flex 3 with it. i found that i needed to create cookie variables for all my session variables i was using in order to maintain and remember who the user was in my CFC calls. i also found that after i compiled a flex app, i changed the .html to .cfm (the file that loads the compiled SWF file). by doing this i was able to pass CF session variables into the flex app and you can refer to these anywhere in Flex by using Application.application.parameters.{variable name here} 
    add the CF variable in the FlashVars line to pass it into Flex (see the last line of code). this will create a variable (in my case i'm passing session.employeenumber). then in your flex app you can reference it by using Application.application.parameters.emplid:
    AC_FL_RunContent(
       "src", "Request",
       "width", "100%",
       "height", "87%",
       "align", "middle",
       "id", "Request",
       "quality", "high",
       "bgcolor", "#869ca7",
       "name", "Request",
       "allowScriptAccess","sameDomain",
       "type", "application/x-shockwave-flash",
       "pluginspage", "http://www.adobe.com/go/getflashplayer",
       "wmode","transparent",
       "FlashVars","emplid=<cfoutput>#session.employeenumber#</cfoutput"
    A little trick I learned (does Adobe really expect us to re-engineer how our apps have been working by no longer using sessions for Flex?). Then in your CFCs if you also create cookies for every session variable you can maintain the variables based on user login. HOPE THIS HELPS!
    -Matt

  • Business Objects Enterprise SDK application.

    Hi All,
    I am planning to develop a custom web application using BOE 3.1 java SDK's.
    I would like to create only application level users, these users would be mapped with a single BO user account to create enterprise session.
    That means, My application "A" will have say 10 users (i.e. 10 userid and passwords). All these users will their different sets of userid's and passwords (custom application users), they can login into the application using application level credentials,  however to login into the enterprise the application will internally use only one BO user credential (i.e. only one named user acount info.)
    eg:
    user1-login -> application>logins using BO userX userid and password>BO Enterprise session created
    user2-login -> application>logins using BO userX userid and password>BO Enterprise session created
    user3-login -> application>logins using BO userX userid and password>BO Enterprise session created
    and so on.
    The idea is to purchase only one named user licence and create many application level users to login into BOE; but using the same BO user account.
    Is this approach legal in-terms of licensing?
    Would appreciate any help on this.
    Regards,
    Jon

    Hello Adam,
    Thank you very much.
    Please see the following post:
    Business Objects Enterprise 3.1 Licensing
    Tim says:
    names means you can have five users created, any amount logged on concurently (i.e the administrator could have 10 sessions, usera 20 etc no limit) But you can only create 5 different users names
    that means 1 Named user eg: 'A'  can login into the enterprise using his credentials and create any amount of enterprise sessions concurrently for self right??
    Each named user is for a specific user and not to be shared. If you were using concurrent user licensing, than this would be ok to use one enterprise user account.
    5 Concurrent linceses means one user account created in enterprise but, account info can be shared with 5 users, so they can login using same credentials and create five different enterprise sessions?? right?
    so, I can purchase one- 5 concurrent user license and share it with 5 users? OR purchase 5 named user licences and share it with 5 users?
    Either ways my understanding is number of users=number or linceses available (named or concurrent). please correct me if I am wrong.
    Now, which one is cost effective named user lincenses or concurrent?
    Awaiting your response.
    Regards,
    Jon

Maybe you are looking for