Can standard JSP access Faces SessionBean and ApplicationBean? How?

Hello,
I have a situation where in I have some JSF based pages in my web app, along with with some standard JSP pages - these are all part of the same webapp.
Is it possible to access the SessionBean (the web session bean that is - netbeans default is SessionBean1 which extends AbstractSessionBean) and likewise ApplicationBean(1) objects from these standard JSPs that are part of the same web application? Any help on how this could be accomplished?
Thanks

Scriptlets runs at another scope than JSP EL. Scriptlets runs like as a local Java method. JSP EL lookups the references in pageScope (pageContext.getAttribute()), requestScope (request.getAttribute()), sessionScope (session.getAttribute()) and applicationScope (servletContext.getAttribute()).
'app' is not available as a local variable in scriptlets. To get it in a scriptlet, you should be doingObject app = session.getAttribute("app");
// or rather without the useBean thing, assuming that it is been put in application scope.
Object applicationBean1 = getServletContext().getAttribute("ApplicationBean1"); and cast it back to the desired type.
Having said that, doing that so in a scriptlet is a bad idea. Also, your jsp:useBean tag is creating a new instance instead of reusing the ApplicationBean1, because you assigned it a different 'id' (it must be the same as the managed bean name) and you are looking it up in the session scope instead of application scope (of which I assume that the ApplicationBean1 is put in, looking at its name).
It might be a good idea to take a step back and elaborate about the bigger picture what you're trying to accomplish. The code as you've posted as far is really a smell. Better do it in JSTL or in a Servlet instead of in a scriptlet.

Similar Messages

  • Why can't I access the internet and e-mail on wifi in my house, but, I can if I turn wifi off?

    Why can't I access the internet and e-mail on wifi in my house, but, I can if I turn wifi off?

    Hello srpeters5,
    Thank you for the details of the issue you are experiencing with Wi-Fi on your iPhone.  You have taken some really good steps to troubleshoot this issue already.  I found an article that includes a few additional steps you can try.  You can skip any steps you have already taken.
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/ts1398
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Why can one mac access the internet and not the other?

    Hi I have just installed a 2nd generation Airport Express base station. I have setup a network and I can connect to it to access the web. Here's the rub, only my Macbook Pro can connect. My Macbook Air cannot connect? A weird error message says (translated from Swedish): Airport has the selfapplied/selfselected IP adress 169.254.67.130 and will not be able to connect to the internet.
    Why can one mac access the internet and not the other? Is there something simple that I can do to get more macs to be able to use my Airport Express to access the internet?
    Tech details:
    Airport Express 2nd generation (just purchased) model 1392
    Macbook Pro running 10.8.2
    MacBook Air running 10.6.8

    It seems the Airbook assigns a dummy IP address so somehow it doesn't reach and receive an IP from the Express. I deleted the previous Express setting restarted the Air connected again, restarted the modem, restarted the Express nothing....
    I spoke to the internet provider and the cable modem does not require any username or pw. from the modem to the cable it's one public ip, pure internet is flowing from the modem to the Express but the express doesn't seem to assign any IP address apart from the one assigned to the Macbook Pro.
    Do you need a screendump of the settings on the functioning Mac or the faulty one? What settings are you interested in i.e. which tab should it shot?

  • I bought a Macbook Pro in August 2011, so it has been only 16 months up to now. However, its logic board is broken now. Can I ask 1) where can I buy this mainboard?, and 2) how much does it cost?. Thank you

    I bought a Macbook Pro in August 2011, so it has been only 16 months up to now. However, its logic board is broken now. I want to ask 1) where can I buy this mainboard?, and 2) how much does it cost?. Thank you

    This is one instance where you'll curse yourself for not having bought the AppleCare Warranty extension and gotten the board for free.
    Anyway, get your model number handy and go look up the parts in www.powerbookmedic.com or www.ifixit.com amongst other places. They've also have videos or photo pictorials on how to do the replacement. Not altogether trivial, be sure to spread the adequate amount of thermal paste on the CPU and GPU, else you'll fry the new board in short order again.

  • HT4859 If I select 'delete' backup.  Can I ever access it again, and does delete on all my deviices?

    IF I select delet back in iCloud management and on a particular item that I may want to look at again in the distant future, can I ever access it again.?  And does it delete on all devises it was showing up on?  Thanks so much for any help

    If you delete an iCloud backup it is permanently deleted from your iCloud account.  After that it will no longer appear on any of your devices and you wouldn't be able to access it again.

  • After upgrading to the latest version of firefox. I can no longer access the internet and all traces of Mozilla Firefox are gone from my computer. I have no access to the internet, my home page or my e mails. What can be done??

    I have been using firefox for years. I downloaded the latest version and at the conclusion of the down load I was refussed access to the internet. Something about Proxy???? I checked my firewalls and security and they said that mozilla was allowed but everytime I attempt to gain access I am refused. I cant access the internet and I cant download another program to access the internet. I uninstalled Firefox and attempted to reinstall but after uninstalling Firefox I have no means to reinstall because there are no traces of it on my computer and I no longer have access to the internet. What do I do? I cant access my e mails, stored messages, favorites etc etc.

    No. After I select "Choose" the dialog box expands to provide only three choices. This is a new bug. I have only seen it in the past week or so, but it is maddening. I have observed that, while the Mozilla Foundation focuses on trivialities like which search engine should be the default, the Firefox application becomes buggier and buggier. Most of my family has switched to Chrome, and I will be following shortly. Firefox used to be a great program. Not any more. Getting assistance with a problem has also become very difficult.

  • TS1368 Can't fully access iTunes store and need some help. Error code 1202

    I can't fully access the iTunes store.  In iTunes, I can't view graphics on the main page; the text is not formatted; links result in a message that an unkonwn error has occurred (-1202).

    Yuk, this one seems to be a windows issue IIRC.

  • Can I remotely access HDs, printers and computers connected to APEX?

    I currently have an external HD, 2 printers and a desktop (currently a dell, soon to be an iMac) connected directly to my Airport Extreme, and I have a MacBook which I connect via WiFi.
    First of all, can I access my Airport Extreme remotely (for example, from work) with my MacBook?
    I currently use my External HD for Time Machine backups. I also use it to store various files (one of them being my iTunes library) that I like to be able to access on both computers. Can I access this remotely to a) use for Time Machine and b) access the files stored on it?
    Am I able to access my printers if I wanted to print something at home while I'm elsewhere?
    Finally, once I get my new iMac, would I be able to access that as well? I would like to be able to wake it from sleep and access files stored on it, control it, etc.
    If these things are in fact possible, how would I go about configuring my setup to do all this?
    Edit: Bonus Question - Can I do any of the above items with my iPhone as well?
    Message was edited by: John.Kitzmiller

    The easiest way to accomplish this would be to get MobileMe which will keep everything synced and allow you to access Back to My Mac to screen share your iMac at home. This would allow you to view the hard disk, assuming it is connected to the home network. As of yet, I do not believe you can back up your mac from a different network. To print from anywhere in the world you need to go to AirPort Utility and click on printers. Check share printers over ethernet port and check advertise printers globally using Bonjour. After you have done that, head over to System Preferences. Click on Print & Fax. Complete the steps necessary to set up your printer over Bonjour. (Sorry don't know the exact steps, never done it.)

  • How Can I Disable Access Keys - Alt- and Ctl- on All Web Sites?

    How can I tell Firefox to Disable the use of Access Keys such as Alt-? and Ctl-? on All Web Sites?
    Thanks.

    See:
    *http://kb.mozillazine.org/Accessibility.accesskeycausesactivation
    *http://kb.mozillazine.org/Ui.key.contentAccess

  • Why can't I access the "webpage" and "bookmarks" tabs in Safari on my iPad2?

    Sometimes when I'm using Safari, I can't access other webpages that I already have open. I click on the tab multiple times, but I stay on the current page. I also can't access any of my bookmarks (basically, none of the buttons next to the search bar work for me).
    I essentially have to wait until the browser crashes, and then everything works normally. What is going on?!

    See if any of these things make a difference.
    Quit Safari and restart the iPad - Go to the home screen first by tapping the home button. Quit/close open apps by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner to close the apps. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go to Settings>Safari>Clear History, Cookies and Cache. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • Why can't I access the internet and everyone in my house can?

    My laptop was getting signal since I moved into this house in the Summer. I went home to LA for a few days and when I came back one of my housemates got a new modem. Everyone else's laptop work(including 3 other mac book owners) fine but I cannot get access to the internet. What do I need to change or do? Im not so great with technology but I tried different options, she took off and on the password from the wireless internet and nothing. As well, I noticed 2 other icons at the top of my laptop next to the battery life icon..One looks rectangular and black..and the other one looks like this <.....>. Weeks have passed by and I'm just getting tired of having only access to the internet in school.
    Thanks! Hope someone can help me because I need it for school.

    personalities_233 wrote:
    Hello, thanks for the help but it did not work. I wonder what the problem is? =/
    What did not work?
    Did the airport router you are trying to connect to not show up under the airport symbol in the menubar?
    If it did show up, did it have any symbols by it like a padlock for instance?
    In other words, exactly what did you do and exactly what did you experience?
    If your Mac does not even list the router in the menubar under the icon/symbol (triangle with curved lines, supposed to appear to be radio waves radiating) then the router may have a setting set that does not allow it to be seen except to computers with MAC addresses that have been entered into it as allowable. If this is the case then your MAC address will have to be entered into the router's list. MAC stands for Media Access Control. "Mac" is the abbreviation for Macintosh.
    The fact that you mention you have two new symbols in your menu bar suggests that someone has been playing with the computer and making changes that you are unaware of. If this is the case then there are many possibilities for problems.
    The fact is, a Mac fresh out of the box will see any router within range and connect to it unless the router requires a password or the router has Access Control set such that it cannot be seen by a computer that does not exist in its 'OK' list. Since yours works at school, that rules out a hardware or problem or most software problems with your computer. But networking is complicated enough that you have to be quite specific when you try to tell others what you have tried and what results you got.

  • Can't remove Access Connection​s and ThinkVanta​ge Toolbox icons from taskbar

    I've just re-installed from my Lenovo system back-up disks. 
    The Lenovo Power Controls icon on the taskbar was easy enough to remove. There was a checkbox under Options.
    The Access Controls options show a checkbox to remove that icon as well, but the entire screen is grayed out (inactive). I changed to my admin account and unchecked all the boxes (the screen even says it will affect all users). I also went into the Global settings and unchecked the box there as well (not sure why it's in two places). I rebooted. The icon is still in my non-admin account, although it is gone from the admin account. 
    On the admin account, all the boxes are unchecked. On the non-admin account, the "Show Accees Connections icon on taskbar" is still checked, but still grayed out. Not sure how to proceed. Definitely do not want this big, ugly icon on my taskbar. 
    Also, the ThinkVantage Toolbox icon suddenly appeared on this install (wasn't there before, haven't ever seen it). This one doesn't even have an options section with a checkbox to remove it from the taskbar. It also never showed up in the admin account from day one, only in the non-admin account.
    Any information on removing these two icons from the taskbar would be greatly appreciated.

    As far as the Lenovo Thinkvantage Toolbox icon, this is probably PC-Doctor.
    Launch PC-Doctor.  Click the settings button.  You can then uncheck the show icon in taskbar item.

  • Can multiple users access the account and use services on different computers?

    ?

    Hi vighter,
    A subscription is tied to an invididual Adobe ID and password. The licensing agreement allows that user to access the subscription on up to two devices, but not at the same time.
    Best,
    Sara

  • My husband just got me an iPad 2 for Mothers day and today when I tried to sign on it is saying I don't have any cellular data left?  I'm at work and we have wi-fi, why can't I access my webmail and the internet with just that?

    My husband just got me an iPad2 for Mothers day and today when I tried to sign on to it it said I do not have a cellular data network?  I'm at work where we have Wi-fi.  Can't I just use that to sign onto my webmail and to get onto the internet?

    If you are in a wi-fi only area, then you need to join a wi-fi network. Does your office have wi-fi? Has the Admin given you the iformation to join the wi-fi network?
    To join a wi-fi network...
    1. Go to Settings/Wi-Fi
    2. Tap Other...
    3. Enter the name of your wi-fi network
    4 Tap Security
    5. Tap the type of security the network uses and return to Wi-Fi
    6. Enter the password and tap Join

  • How to access faces context and backing beans in a servlet filter

    I find this popular solution:
    http://www.thoughtsabout.net/blog/archives/000033.html
    Anyway it dosn't work in presence of a redirect:
    java.lang.IllegalStateException: Cannot forward after response has been committedThe problem is here I think:
    NavigationHandler navigationHandler = facesContext.getApplication().getNavigationHandler();
            navigationHandler.handleNavigation(facesContext, "", Constants.ITEM_OUTCOME);
            request.getRequestDispatcher(facesContext.getViewRoot().getViewId()).forward(request, response);If navigation rule ITEM_OUTCOME has a redirect, handleNavigation make something on the response? and then I can't dispatch to the new page.
    Do you know some solution?

    The solution is:
    NavigationHandler navigationHandler = facesContext.getApplication().getNavigationHandler();
            navigationHandler.handleNavigation(facesContext, "", Constants.ITEM_OUTCOME);
    if(facesContext.getResponseComplete()) {          request.getRequestDispatcher(facesContext.getViewRoot().getViewId()).forward(request, response);
    }Do you know some better method than facesContext.getResponseComplete()to be sure reponse received a redirect?

Maybe you are looking for

  • Aggregate function not working correctly

    I have this data in a table SZSTCLA_PIDM     SZSTCLA_TERM_CODE       SZSTCLA_TERM_CODE_MATRIC     SZSTCLA_TOTAL_CREDITS 82724                        201010                                               201010                      4.50 82724          

  • What is a web filter and why is it prevetning me from using firefox?

    Firefox allows me to search on google but as soon as i click the next link/to go on the page i want is doesnt work. Instead it talks about a web filter saying that the page i tried to visit could not be checked by web filter. This also happens when i

  • Column Security Queries generated by FORMS Performs bad on 11g(11.1.0.7)

    We are busy Upgrading our DB from 10g (10.2.0.4) to 11g (11.1.0.7). We are currently using Oracle Application Server (10.1.2.0.2) with Form and Reports connecting to our 10.2.0.4 DB. The Application Server is not being upgraded as there are compatabl

  • Generating error page(in jsp) when session expires....

    hello, i want to generate error page(in jsp) when session get expires... plz help me out.............

  • MAIL suddenly stopped working yesterday

    It will not go online anymore. I checked my server email via the Safari browser and I've got all kinds of mail accumulating there. I've sent myself emails from yahoo's mail and they do not get to MAIL anymore. I've done a check via Sytem Prefs/Networ