What's the best way for a web app to handle logins and sessions?

I'm deploying in JBoss, using JSF. As is often the case, I keep User information in an entity bean. My question is, what's the best way to handle this bean?
My inclination is to create a login page with a LoginBackingBean atached to it. When the user attempts to log in, it will see if there is a User entity bean that corresponds to the given name and password. If there is no User bean that matches, obviously we show an informative error screen.
But what happens if there is a valid user?
In the plain old Servlet world (without EJB / J2EE) I would just put the User object (it's an object, not an EJB) into the HttpSession, and I would create a Filter that would check for the presence of that User object, and I would map the filter to something like /members/*, and that would be it. I would use Hibernate to persist the User object, and there would also be a filter that creates a Hibernate session and stores it in the Request so that the User object would work and persist.
How do I do this within the J2EE / EJB world?
My first thought would be to just do the same thing. Install the User bean into the HttpSession, and create a filter and do all the same stuff. Is that the right way to do it? It would work pretty well with JSF because I could just access things in the normal JSF way: #{user.firstName} would find the "user" object in the HttpSession scope. So that's good.
One question that comes up from that is if the user makes some change to the User object that is in the Session scope, will the EJB automatically do the right thing and make those changes persistent? Is there anything else I need to do?
I'm new to the EJB world, but from what I can see so far, it seems like it's the best way to think about a web application.
Thanks

hi ,
i think the best way is to create java beans ,in that bean call your EJB ,
and check the validation over there.
and make that bean scope to session.
in each and everypage try to check the session ,if it is not valid then forward to your login page...
otherwise continue to give access to him like guest
Regards,
AfTaB

Similar Messages

  • WHat is the best way for other iphone users to share pictures with me?  I am doing a project which req. people to send me 100 pictures at a time that I'll be putting in my iphoto?

    WHat is the best way for other iphone users to share pictures with me?  I am doing a project which req. people to send me 100 pictures at a time that I'll be putting in my iphoto? thank you.

    ingridlisa,
    I'd suggest to ask them to create Shared PhotoStreams and to invite you to view the streams, see:
    iCloud: Using and troubleshooting Shared Photo Streams
    Regards
    Léonie
    Added:
    that I'll be putting in my iphoto?
    Will you be collecting the photos in iPhoto on your iPhone or on a Mac? On a Mac a Shared PhotoStream requires Mac OS X 10.8.2.

  • Acrobat Standard XI, but can only find the CD for windows.  I have a mac (I have access to an external CD drive and I have the product keys for windows).  What is the best way for me to install it?

    Hi, I purchased Acrobat Standard XI, but can only find the CD for windows.  I have a mac (I have access to an external CD drive and I have the product keys for windows).  I have never installed it anywhere else.  What is the best way for me to install it?

    Hi lintonm86921521,
    I can understand your concern & will guide you through this.
    I am so sorry to inform you that Acrobat XI Standard is not available on Mac, you can only use it on your Windows computer.
    You can also refer to the system requirements at : System requirements | Acrobat family of products—older versions (XI, X, 9)
    In case if you have any further query please let us know, we will be happy to help you.
    Regards,
    Aadesh

  • HT4914 I purchased iMatch because my old computer was failing and I was afraid of losing my music library. Now I bought a new laptop; what is the best way for me to transfer my library to my new laptop? Will iMatch help me do this?

    I purchased iMatch because my old computer was failing and I was afraid of losing my music library. Now I bought a new laptop; what is the best way for me to transfer my library to my new laptop? Will iMatch help me do this?

    Is/was failing or has failed?
    If the old computer still runs one of these methods may be best.
    Method 1
    Backup the library with this User Tip.
    Restore the backup to your new computer using the same tool used to back it up.
    Deauthorize the old computer if you no longer want to access protected content on it.
    Keep your backup up-to-date in future.
    Method 2
    Connect the two computers to the same network. Share your <User's Music> folder from the old computer and copy the entire iTunes library folder into the <User's Music> folder on the new one. Again, deauthorize the old computer if no longer required.
    I'd recommend method 1 since it establishes an ongoing backup for your library.
    I don't have personal experience with iTunes Match, but in principle you should be able to download all the tracks currently registered to your iTunes Match account. This isn't quite the same as restoring your previous library exactly as it was. There is always the potential for iTunes match to provide the wrong version of a song and could be content such as movies, podcasts, audiobooks etc. that would have been excluded.
    tt2

  • I am looking to start developing apps for the iTunes Store, but I have no previous experience. What is the best way for me to start on this? As in which programs and materials must I need and what I need to know. Thanks!

    I am looking to start developing apps for the iTunes Store, but I have no previous experience. What is the best way for me to start on this? As in which programs and materials must I need and what I need to know. Thanks!

    You will need a Mac, with OS X 10.6+ on it, to be able to develop iOS apps.
    There is some info on these pages :
    developer site : https://developer.apple.com
    developing for iOS 7 : https://developer.apple.com/ios7/
    developer support : https://developer.apple.com/support/
    developer forums : https://devforums.apple.com/index.jspa (you will need to be a registered developer to access them)

  • Hello, what is the best way for me to convert RW2 raw format for use in Photoshop CC

    Hello, what is the best way for me to convert RW2 raw format for use in Photoshop CC. I would appreciate any help with this.

    Thanks for the quick help. I do have to leave for work. When I try to
    download the images from the camera they seem to only be in jpeg (I don't
    see any rw2 or raw files to download). If I select the jpeg file it seems
    to only download a jpeg file. I do understand that I do have the option to
    open the jpeg in RAW. In doing this, is all the extra information included
    in the RAW file there or is it lost coming from the camera
    Once again thank you for trying to make me understand how this works.
    Have a great day.
    On Sat, Sep 13, 2014 at 12:14 PM, ssprengel <[email protected]>

  • What is the best  way for using a  C++ in the EJB?

    What is the best way for using C++ in the EJB ie
    either 1. Socket programming
    2. JNI

    To what purpose?
    To use C++ in the client you could generate IDL from your remote interfaces and run that through your vendor's IDL-to-C++ processor.

  • What's the best way for home sharing to iDevices without iTunes?

    What's the best way for home sharing movies and tv shows on my iDevices?  I know I can use home sharing through iTunes, but I'm looking for a way to share videos to my iDevices without having to leave my computer on.  I have a MacPro, iPhone, iPad, Airport Extreme, and Airport Express (and several external hard drives).  Can anyone suggest an app that would do this?  Can I have videos on an external hd attached to an Airport Extreme/Express and have it stream without iTunes?

    If your "server" is new enough to run Mountain Lion, you can purchase the OS X Server app from the Mac App store and you'll have everything you need to host a NetInstall (NetBoot) server.
    If your machine does not support Mountain Lion, you'll need to purchase the appropriate Mac OS X Server software (i.e. Lion Server or Snow Leopard Server)
    From there you can host NetInstall or NetRestore images, depending on your preferred workflow, which can be created using System Image Utility.
    As Richard points out you can also use Deploy Studio which, again depending on your preferred workflow, might simplify things.

  • My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

    My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

    My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

  • [Solved] What's the best way for me to help with Arch?

    I've been using Linux for about 10 years and Arch for a little over a year.  I used to do a lot of distro-hopping but I've found that since finding Arch, I haven't been doing much of that.  I don't know why it took me so long to find it.
    Anyway, I'd like to give back a little so what's the best way for me to help?  I'm not a programmer so I'd be no help there.  I have made a couple contributions to the wiki and filed a bug.  I know that kind of stuff is easy and obvious.  Is there anything else I could be doing?
    Last edited by brianhanna (2010-04-07 02:25:34)

    I hear the Arch Linux Magazine could always use some contributions, if you're inclined towards that sort of thing. I've been wanting to write an article for a while, but I've not run into anything in my Arch experience so far that's really inspired an article out of me.

  • What is the best way for my wife to sync her Outlook contacts to her new iPad Air?

    What is the best way for my wife to sync her Outlook contacts to her new iPad Air?  I don't know very much about Microsoft (almost nothing).  Does she need to plug into one of the USB ports on her Microsoft computer (about 5 years old)?  I also have an iMac (that I use for syncing but she needs her contacts from Outlook.  She doesn't really want all of them...there are 1,000's of teachers that work in her district and she does no tent to add 1,000's of contacts.

    If she only has a few she can e-mail those contacts to herself, open that mail on her iPad and save them from there.

  • What is the best way for my partner and I to share our work across computers?

    What is the best way for my business partner and I to share our work (projects, libraries, images) across computers without emailing items?  Is there creative cloud storage place we can share?

    Can't I just purchase the 200 GB storage, throw our photo library in it, share it with her, and have both of our new and future pics dumped into it?  If so, how do I do that?
    The iCloud Photo Library cannot be shared between users, unless you are using the same AppleID.
    You can share selected photos with shared albums:  iCloud: iCloud Photo Sharing FAQ
    Or create a Photos library on an external drive, that you both can access, as described here for iPhoto:   iPhoto: Sharing libraries among multiple users

  • What is the best way for sharing an iPad with 2 iPhones using different Apple acount ?

    What is the best way for sharing an iPad with 2 iPhones using different Apple acount ?

    You can't share with other devices if you are using different Apple ID's and iTunes account on them. You can only share if you use the same ID.

  • HT204053 We bought our daughter a iPad mini for christmas. Should we set her up her own apple ID or use the one we have. What is the best way for her for school?

    We bought our daughter an iPad Mini for Christmas. Should we create her own apple ID or use the one we currently have for her device as well? What is the best way for her school work?

    Her own ID.  You cannot transfer purchases between IDs so anything bought on your account will require your authorization should she need to download in the future.

  • What is the best way to build an app?

    what is the best way to build an app?

    I've never done it, but sure, all sorts of companies will contract to code up an application for you - big companies like Honeywell and General Dynamics to Joe Programmer free-lancing out of his house will contract for computer coding projects.  Without knowing details of the app to be developed I have no idea what it would cost or how long it would take.  Some of the free-lance programmers I personally know bill out at over (some, well over) $100/hour.
    If you really think your idea is great, then be sure to approach discussing it with a developer as a business transaction.  Almost every company will have an unsolicted ideas policy in place (Apple explicitly does under their legal information page) and any unsolicited ideas sent in become the intellectual property of the company (by sending the idea unsolicited, you have legally "given" it to them).
    P.S. as to how long to learn how to program well?  Some people spend an entire college degree's worth of time and effort to master that.

Maybe you are looking for

  • Error on installation of LabVIEW Run-Time Engine 8.5.1: "This application has requested the Runtime to terminate it in an unusual way"

    Hi, a colleague in India cannot install the LabVIEW Run-Time Engine 8.5.1 on Windows XP. On attempting to install, an error box is shown, which says: (window title) Microsoft Visual C++ Runtime library: (message box text) Runtime error! Program: C:\N

  • LV2010 - Error 74 Application Builder

    Hi, I have migrated a LabVIEW project from LabVIEW 2009 SP1 to LabVIEW 2010. Everything works fine - execution in development system - except the compilation of the build specification. I have tried it several times with different options --> new pro

  • SOAP communication Channel inactive

    Hi Forum, We have some SOAP sender and receiver channels, in the integration Directory, which are all active there, but, in the RWB i can see all of them as inactive, with message in RWB as "Channel started but inactive" , why so, can u pls help

  • One dimensional line segments

    Hi, I 'm facing the problem of indexing temporal intervals and performing interval intersection queries. I 've seen timestamp and interval data types but no information about the existence of a temporal indexing scheme or interval query operators, bu

  • All my icons are itunes

    i dont know what happened, but all my icons turned into itunes icons and only take me to itunes...