How can a session scope bean access an application scope bean - help

Hello,
I have a JSP page that has references to an Application Scope and a Session Scope bean...
<jsp:useBean id="myWebApp" scope="application" class="com.my.web.WebApplication" />
<jsp:useBean id="myWebSession" scope="session" class="com.my.web.WebSession" />
I would like the WebSession access methods in the WebApplication ... Can/ How does the WebSession object lookup the reference to WebApplication object?

I don't think you should make the WebSession implement the session listener.
The session listener will be created once, at the start of the servlet context and would be listening to all sessions. So you would have one instance of the WebSession belonging to the context (though not as an attribute), and others belonging to each session. This will be confusing in your code, I think.
I would suggest having a different class act as the HttpSessionListener. Perhaps do something like this:
public class WebSessionInjector implements HttpSessionListener {
  public void  sessionCreated(HttpSessionEvent e) {
    WebApplication webApp = (WebApplication)(e.getSession().getServletContext().getAttribute("webapp"));
    WebSession mySession = new WebSession();
    mySession.setWebApplication(webApp);
    e.getSession().setAttribute("mySession", mySession);
  public void sessionDestroyed(HttpSessionEvent e) { ... }
}You may be able to use the WebApplication object itself as the listener ...
Or, you could make the WebSession implement the HttpSessionBindingListener and use the valueBound event much like the sessionCreated event above, but from inside the WebSession object:
public class WebSession implements HttpSessionBindingListener {
  public void  valueBound(HttpSessionBindingEvent e) {
    WebApplication webApp = (WebApplication)(e.getSession().getServletContext().getAttribute("webapp"));
    this.setWebApplication(webApp);
  public void valueUnbound(HttpSessionBindingEvent e) { ... }
}

Similar Messages

  • How Can I Import Primary contacts in new application? Pls Help...!

    Hi All,
    I am Importing Company Contacts from one SOD system to another SOD application (Copy of the earlier SOD). Can anyone tell me how can I import Primary Contact value?
    Company Contacts are successfully Imported but Primary contact checkbox is not set for anyone, Pls let me know if there any way to import that?
    Regards,
    Abhay

    Abhay, the first contact imported for an account will be the primary contact. There is not a separate import to indicate the primary contact.

  • How can I give me the access to create a developer key in the market?

    Hi!
    I'm new in the basis area and I don't have access to create a developer key. A consultant need a developer key.
    How can I give me the access in the market place to create it?
    Thanks!

    Hi
    You need to get the access key from SAP.
    Refer to the procedure of obtaining access keys from SAP in BASIS.
    Security
    Regards,
    Raj

  • TS1363 I have windows 8  and itunes 11.1 ... it identifies my iphone 4 but insists that I either update my phone to OS 7 or restore to by basic 6.1.3 OS  I don't want to do either.  How can I get  itunes to access my iphone ?

    I have windows 8  and itunes 11.1 ... my laptop identifies my iphone 4 but  itunes insists that I either update my phone to OS 7 or restore to by basic 6.1.3 OS  I don't want to do either.  How can I get  itunes to access my iphone ?

    RealPlayer can cause conflicts with Flash Player because it tries to assign EVERY TYPE of video or audio file to itself by default. I haven't used RealPlayer in years for that reason. It's an unnecessary program anymore. There are apps loike VLC media player that cna do EVERYTHING it does without conflicting with other apps like Flash Player.
    With WIndows 8, Microsoft began embedding FlashPlayer themselves into Internet Explorer. Because of that, you cannot download and install it from here. You cannot uninstall it from Internet Explorer without removing a specific Windows Update first. And you cannot update it via this website. ONLY through Windows Update can Flash Player for Internet Explorer be updated.
    That said, you probably DON'T have a virus that's causing the problems with Flash Player and Internet Explorer. Many, many websites are not "recognizing" the browser.
    This is a known problem with Internet Explorer 11, which Microsoft has been aware of since October 18 when they released IE11 The pages can't recognize the browser, so they don't recognize any of the plugins, like Flash Player.
    So far, Microsoft has made NO indication that they have any plan to fix it soon.
    Microsoft's recommendation is to use Compatibility View for affected pages, and "pretend" you're using an different browser. Trouble with that is it has seen limited success at best, and you have to individually enable it for EVERY page that has problems.
    I'm not big on "pretending" so I recommend actually using another browser.
    Firefox (from Mozilla)
    Opera (from Opera)
    Safari (from Apple)
    Chrome (from Google)
    ANY of those will work where IE11 won't, with the Flash Player Plug-in (For all other browsers), and Chrome doesn't even need that because it has its own Flash Player plugin built in.

  • How can you change your line access selection?  I have found where you can change your plan selection, but can you change the line access fee or is that a set amount?

    How can you change your line access selection?  I have found where you can change your plan selection, but can you change the line access fee or is that a set amount?

        DIVAB71,
    Great question. The line access fees for the account are a set amount and can not be changed unless you are going from a basic to a smartphone or vice versa. If you are wondering about adding the month to month discount if you are out of contract Ann154 has provided great information on how to access and add the feature.
    LindseyT_VZW
    Follow us on Twitter @VZWSupport

  • My iPhoto library just reverted to an old library: How can I find, and re-access my current library?

    My iPhoto library just reverted to an old library: how can I find and re-access my current library?  I opened my iPhoto, and got the message that it needed to "update" to use this library.  I thought maybe there had been a software update since I last opened the program (2 days ago).  The library it opened was saved in a file on the desk-top.  My current file was just in iPhoto.  Please help!

    Best option: Restore from your back up.
    Otherwise:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • How can i add an administrator access so the admin can edit his webpage on the web browser?

    How can i add an administrator access so the admin can edit his webpage on the web browser?

    A content management system or CMS is software usually on the server that allows client's to log-in and edit content from any web browser with an internet connection.  These web pages are typically built with server-side programming (PHP) and databases (MySql). 
    CMSs come big and small.  The right one for your project depends on
         a) your programming skills,
         b) project requirements,
         c) budget.
    COMMERCIAL CMSs:
    Cushy CMS (watch the video to see how it works)
    No PHP or databases required.  Editing is performed on their web site.
    http://www.cushycms.com
    Perch ($59 license per site)
    PHP & MySql required
    http://grabaperch.com/
    WebAssist Power CMS Builder - Extension for DW
    PHP & MySql required
    http://www.webassist.com/dreamweaver-extensions/powercms-builder/
    Adobe Business Catalyst (full subscription includes CMS & web hosting)
    http://www.businesscatalyst.com/
    OPEN SOURCE CMSs:
    Get Simple CMS
    PHP & XML required.
    http://get-simple.info/
    e107 CMS
    PHP & MySql required
    http://e107.org/
    WordPress
    PHP & MySql required
    http://wordpress.org
    Joomla!
    PHP & MySql required
    http://joomla.com
    Drupal
    PHP & MySql required
    http://drupal.com
    Concrete 5
    PHP & MySql required
    http://www.concrete5.org/
    Nancy O.

  • How can a session have an ACTIVE status with a WAITING state

    Hi all,
    I would like to know the difference between status and state of a session ?
    The documentation says :
    for status ACTIVE : Session currently executing SQL
    for state WAITING : The session is currently waiting...
    How can a session execute a SQL statement and be waiting at the same time ?
    Regards,
    fcjunic.

    Hi fcjunic,
    It's really not paradoxical, once you understand the definition of the terms.
    First, we have V$SESSION.STATUS, which can be ACTIVE or INACTIVE. A session is ACTIVE if it's in a database call. So, think of this from the client side point of view. A session does a parse call, or an execute call, or a fetch call, etc. For the duration of that call, till control returns back to the client, that session is said to be ACTIVE.
    From the time the calls returns, till the time of the next call, the session is INACTIVE.
    Next, we have V$SESSION.STATE. This is probably more useful to think of from the server process point of view. This refers to whether the server process is currently running, i.e. on the CPU, or WAITING, i.e., waiting on a resource. Possible values for this column are WAITING, WAITED KNOWN TIME, WAITED SHORT TIME, and WAITED UNKNOWN TIME. Of those possibilities, a session is only actually waiting if STATE is WAITING. All the other values mean that it's no longer waiting, but is running on CPU.
    A session w/ STATUS of INACTIVE, will always be in STATE of WAITING, waiting on the 'SQL*NET message from client' wait. So, in that case, it means the server process is waiting around for work to do. It's in between calls, so, STATUS is INACTIVE, and it's waiting on that network port, to receive the next call from the client.
    An example of a session that's ACTIVE and has STATE of WAITING, would be a session that's, for example, doing a full table scan. So, it's got lots of data to read from disk. While the session waits for the read from disk to complete, the session waits on 'db file scattered read'.
    Finally, for completeness, the difference between the different possible values of the STATE column. I already covered WAITING. If a session is not waiting, it's now on CPU, and it previously waited. If so, it either waited more than 10 ms, in which case it will report WAITED KNOWN TIME, or less than 10 ms, in which case it reports WAITED SHORT TIME, or timed_statistics is false, in which case this column will always be WAITED UNKNOWN TIME. Also, it's important to pay attention to this column, when trying to interpret the WAIT_TIME and SECONDS_IN_WAIT columns.
    See here:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10820/dynviews_3016.htm#REFRN30223
    for more information.
    Hope that helps,
    -Mark

  • How can i telnet or get access to other LAN members in LAN without using third party software?

    I have admin access to the main  router in our LAN, so how can i telnet or get access to other LAN  members in LAN without using third party software?
    its linksys3500 router and  i login as admin using the gateway address in address bar..
    i  want to access the c drive of my colleague in same subnet in same  office and i know his ip address.but he not configured telnet accept  request.so without it how can i open his telnet port and access him

    I think you are using the wrong terminology. You can browse the hidden share of any pc if you know the ip and have a valid user account on the pc by typing in the following \\computername\c$ or \\ipaddress\c$ . It should prompt you for a user account. You may have to allow this through the windows firewall (or disable it completely).

  • I have admin access to the main router in our LAN, so how can i telnet or get access to other LAN members in LAN without using third party software?

    I have admin access to the main router in our LAN, so how can i telnet or get access to other LAN members in LAN without using third party software?
    its linksys3500 router and  i login as admin using the gateway address in address bar..
    i want to access the c drive of my colleague in same subnet in same office and i know his ip address.but he not configured telnet accept request.so without it how can i open his telnet port and access him

    Duplicate post. 

  • I'm suddenly unable to join my Airport network with my PowerBook G4.  I am able to access my network with all of my other devices.  How can I once again establish access using my PowerBook G4.

    I'm suddenly unable to join my Airport network with my PowerBook G4.  I am able to access my network with all of my other devices.  How can I once again establish access using my PowerBook G4?

    Bruce777 solved this for me, thank you Bruce! My printer now works perfectly on my new wifi network!
    Bruce's  instructions, for anyone else having the same issue:
    - delete any previously set up printers
    - scrub old hp software and update software to get the hp 2.8 drivers
    - remove the usb cable from the printer if you have one connected
    - reset the printer network to hpsetup (hold down the power button and press network button 2x and then cancel 3x, release power button.)
    - print out the wireless network test report (hold down the network button and press the update button 2x). verify the network name / ssid is hsetup
    - got to sys prefs > network and change the mac wireless network to hpsetup
    - go to the sys pref > print scan
    - add the HP 8000 printer
    - click on the options and supplies button and click on the Show Printer Webpage
    - click on the networking tab > wireless in the left pane > start network wizard and change the network from hpsetup to your network
    - finish (this page may freeze up.  close the browser)
    - go back to the sys prefs and change the wireless network back to your networt
    - go to the printer and print out the wireless network test report (press network button and update button 2x).  Check that the SSID is your network
    - go to sys prefs > print scan > select your printer > options & supplies > show printer webpage > network info (check ssid and compare to wireless network test report)
    - try printing something to your printer.  It might take a little time the first print.

  • When sending/receiving an iMessage (from gmail address) how can I then receive or access my iMessages on my actual gmail account/inbox?

    When sending/receiving an iMessage (from gmail address) how can I then receive or access my iMessages on my actual gmail account/inbox?

    Hi,
    The Messages app can join 5 different services.
    The "iChat Originals" that include AIM, Jabber and Yahoo (although they were added at different times to the app)
    The Bonjour account that has been present for LAN based Mac to Mac chat and lastly the iMessages account in the Messages app that iChat has become.
    Google email IDs can be used as a Jabber ID in Messages as Google run a Jabber server.
    As the Google server does not follow conventional naming formatting it has it's own Add option in Messages.
    Effectively all the services are separate.
    Any email used as an Apple ID can be the iMessages account.
    Of course this may be a Google one like you have that can also be used as  Jabber/GoogleTalk ID or it may be an Apple issued ID (@mac.com @me.com or @icloud.com) that will also work as a Valid AIM Screen Name.
    It may be that someone has their Yahoo email as their Apple ID.
    8:35 pm      Monday; August 11, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • How can I not allow wireless access when extending a network?

    I have two Airport Extremes, one extends the network of the other. How can I not allow wireless access on the remote Extreme when extending a network? I could do it with Airport Utility 5.6, but not with version 6 on Mavericks.

    Correct. Use another Mac or even a PC running Airport Utility 5.x.  Once you have the extending Extreme configured the way you want, Mavericks will not change the setting on the extending Extreme.

  • I have a mac book pro, an ipad and an iphone.  i have an icloud account that allows my iPad and imac to sync.  but my mac book only has a connection to 'mobile me'.  how can i include my macbook with my other devices?  help!  thanks

    i have a mac book pro, an ipad and an iphone.  i have an icloud account that allows my iPad and imac to sync.  but my mac book only has a connection to 'mobile me'.  how can i include my macbook with my other devices?  help!  thanks

    You need OSX 10.7.2 or higher in order to access icloud.  The mobile me account is now defunct (it closed down more than a year ago).

  • How can I disable the Keychain for an application?

    How can I disable the Keychain for an application? A window pops up every time I open a page in Safari asking me for a password. I'm using a student laptop, so while I'm an administrator I lack access to a few things, such as the Keychain Access application. Is there any way to deal with this?

    It's possible you may be able to trick it by creating an Applications folder in your Home directory and moving Safari to it.
    I can't test this but it might work. The problem is that you would miss Safari updates, so you'd have to keep an eye out for them. Another solution may be to download another Safari and install in yourname/Applications.

Maybe you are looking for

  • How to upload file from java client to php

    hi i am trying to upload/send a file from client using swing/applet and receiving it with php code. here is the php code which uploads the post file from the client $uploaddir = "/home/raghavendra/Documents/"; $file = basename( $_FILES["uploadedfile"

  • Creating smartform from attachment list of service object

    Hi,    How can i create a smartform containing attachment list from generic object services(active workflow Box) in tcode VA02, Also let me know in which table this attachment lists are stored. Thanks,    JP

  • Eclipse "cannot be resolved to a type" and new .JAR lib - config prob?

    I'm trying to make use of the Commons HttpClient library in a project being built in Eclipse (3.1). I have a sample program (PostXML) that runs into "cannot be resolved to a type" on the "HttpClient" object. I think the problem is that the JRE 1.4.2

  • Java Web Start issue

    Hi, since we deploy JRE using Software distribution in Active Directory, the msi file provided with the Java installation is not well usable. Not sure, if it is still the case, that triggering the msi file a second time after successfull installation

  • Update table with data from dialog

    Hello, I need the problem. I'm not update table with inputtext field where data change from dialog. This metod is update table. public void returnHandlerGoods(ReturnEvent returnEvent) { // Add event code here... ArrayList<PricatGoods> data = (ArrayLi