A question about JSF login

Hi all!
I am following this link (http://benjmaz.blogspot.com) for handling session in my application.
I am unable to understand that what attributes and methods would be there in the MemberManager class, object of which we have created in LoginBean.java class, please give me some clue about this.
Thanks in advance.
Edited by: 857452 on May 17, 2011 2:22 AM

How can i do if user close browser without logout? You pretty much can't do anything about that, and shouldn't. There is one thing you could do (but probably shouldn't), and that would be to include some javascript on your page to handle the "onExit" (or something like that - I don't know off the top of my head, but there is a way to trap navigating away from a page, which includes closing the browser) event to invoke whatever URL you want to, to tell it the person is "logging out".
Other than that, you could rely on session timeouts, and handle the event on your server side which happens when the session expires.

Similar Messages

  • Basic Questions about JSF, Login and Session

    Hi,
    I try to implement a login/logout function on my jsf-website. I create one <form> with Login and Pass to enter. My AuthenticBean(sessionbean) checks login and pass. If Login is "ok" the login and pass will set in the authenticBean (min. value of login and pass = 2).
    Now I check protected .jsf files (files who need a login) if in the AuthenticBean the login.equals("") or pass.equals(""). If so, the user is not logged in.
    Is this a safe method or should I choose a better way to have secure login/logout functions. Perhaps its better to create a userSessionBean after a succeful login and check it with HttpServletRequest rq.getSession().getAttribute(userSessionBean)?
    I am confused a little bit and I hope you'll help me:)
    Thnx Alex

    Implement a javax.servlet.Filter and indeed use the attributes of the HttpSession.

  • A french question about a login

     

    Et voil&agrave;,
    WindowsUserName : TextData;
    WindowsUserName = task.part.OperatingSystem.GetEnv(name='username');
    Hope this helps
    Fabrizio Genesio
    Datasign AG f&uuml;r Informatik
    ch. d'Eysins 53a
    CH-1260 Nyon
    Switzerland
    Tel.: +41 22 361 04 04
    Fax: +41 22 361 01 10
    e-mail: fabrizio.genesiodatasign.ch
    <mailto:fabrizio.genesiodatasign.ch>
    URL: www.datasign.ch <http://www.datasign.ch>
    -----Original Message-----
    From: Olivier Andrieux [SMTP:oandrieuxaxialog.fr]
    Sent: Thursday, 27 April 2000 11:53
    To: Mailing Liste Forte
    Subject: (forte-users) a french question about a login
    Bonjour,
    J'ai une petite question &agrave; vous soumettre:
    Je voudrais r&eacute;aliser une fen&ecirc;tre de login avec Fort&eacute;, mais pour
    cela il me faudrait r&eacute;cup&eacute;rer les informations
    d'identification de chaque utilisateur sur le serveur
    NT. Questionner le serveur en utilisant les m&ecirc;mes noms et mots de passe
    utilisateurs que le serveur.
    Cela est-il possible ?
    Je vous remercie par avance pour vos r&eacute;ponse .
    A bient&ocirc;t
    Olivier.
    Olivier Andrieux
    Axialog Lille
    France

  • Simple question about JSF configuration

    I am using Tomcat 5.0 in Windows XP SP2. When I create a web application with JSF and put it into {tomcat_home}\webapps\, everything works perfect. But when I add a context path in Tomcat's server.xml such like
    <Context docBase="C:\works\java_projects\jsf_test" path="/jsf_test" reloadable="true" debug="0"/>
    And then I put same web application into this context path and try the url like http://machinename:8080/jsf_test/test.faces, it gives me exception as follow
    I wonder if anyone knows about that? Thanks a lot!!
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet.init() for servlet Faces Servlet threw exception
         org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         java.lang.Thread.run(Thread.java:595)
    root cause
    java.lang.NullPointerException
         javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)
         org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         java.lang.Thread.run(Thread.java:595)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
    :

    FacesServlet.init() processes only the followings:  facesContextFactory = FactoryFinder.getFactory(FACES_CONTEXT_FACTORY);
      applicationFactory = FactoryFinder.getFactory(APPLICATION_FACTORY);
      application = applicationFactory.getApplication();
      lifecycleFactory = FactoryFinder.getFactory(LIFECYCLE_FACTORY);
      lifecycle = lifecycleFactory.getLifecycle(lifecycleId);NPE occurrs at the third line when it can't find ApplicationFactory.
    Check how your container loads the class.

  • Basic questions about JSF/af:panelPage/Facets

    Hi there
    Using JDev 10.1.3.3.0, I created a couple of JSP pages using JSF and ADF BC. Then I added to one of them a af:panelPage and changed the facet branding to be the company logo.
    Do I need to do the same for the other page (and any other pages that I create)? Is there a place where I set this facet value globally?
    And is there a way to set up what facets are included in a af:panelPage by default?
    Sorry if these are basic questions, I am just starting to use JSF!
    Thanks,
    Luis

    facets with af:panelPage.
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps%7Cadfcreate%7Caf_alay_pagecomponent~html/
    http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/web.1013/b25386/web_complex002.htm
    Re: <jsp:include page/> - Error

  • Some basic questions about jsf

    for example, a login page with two input filed(user name and password)and a "submit" button.the code is:
    <h:outputText value="username:" />
    <h:inputText id="username" size="12"   value="#{userBean.userName}" required="true" />
    <h:outputText value="password:" />
    <h:inputSecret size="12" id="pwd" value="#{userBean.pwd}" required="true" />
    <h:commandButton id="submit" value="submit" action="#{userBean.login}" />UserBean's source code:
    public class UserBean {
         String userName;
         String pwd;
         String uid;
          * @return the uid
         public String getUid() {
              return uid;
          * @param uid the uid to set
         public void setUid(String uid) {
              this.uid = uid;
         public String getPwd() {
              return pwd;
         public void setPwd(String pwd) {
              this.pwd = pwd;
         public String getUserName() {
              return userName;
         public void setUserName(String userName) {
              this.userName = userName;
         public UserBean(){
         public String login() {
              if("Jordan".equals(userName))return "login_error";
              return "home";
        private static Log logger = LogFactory.getLog(UserBean.class);
    }in faces-config.xml i define:
         <navigation-rule>
              <from-view-id>/login.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>home</from-outcome>
                   <to-view-id>/index.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>/login.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>login_error</from-outcome>
                   <to-view-id>/login_error.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>now i have a question:
    if a input a incorrect username or password, the page will direct to login_error.jsp.then i click "back" (ie) to login.jsp page,put correct username and password ,click the "submit" button,then the page doesn't direct to index.jsp ,it just clear the two fields(username and password).and then i put the correct username and password again, this time, the page direct to index.jsp.
    why? why i hava to input twice?

    How are you clicking on back? Are you using the back button on your browser or a back button on your page?
         <navigation-rule>
              <from-view-id>/userLogin.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>success</from-outcome>
                   <to-view-id>/index.jsp</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>failure</from-outcome>
                   <to-view-id>/loginError.jsp</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>cancel</from-outcome>
                   <to-view-id>/userLogin.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>/loginError.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>back</from-outcome>
                   <to-view-id>/userLogin.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    You might want to try putting a back button on your error page. Have a look at the navigation rule above

  • Question about SWT Login

    Hi all i'm new to SWT and i was trying to create a login shell to log on to my main shell. My problem is i can't get the shell to read from oracle. The login information is stored in an Oracle database.
    This is my method for capturing login infomation:
    public static String getPass(String UserName, String Password){
    try{
    String login ="Log";
    String nolog = "Invalid";
    dbConn = db.getDBConnection();
    Statement statement = dbConn.createStatement();
    ResultSet rs=null;
    String query = "Select * from administrator where adminName = '"+UserName+"' and      adminPassword = '"+Password+"'";
    rs=statement.executeQuery(query);
    int counter = 0;
    while(rs.next())
    counter++;
    if(counter == 0)
    return nolog;
    else return login;
    catch (Exception e){
    return(e.toString());
    Here is a code snippet from my main method:
    btnLogin.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected (SelectionEvent e) {
    String Username = txtUserName.getText();
    String Password = txtPassword.getText();
    String Check = getPass(Username, Password);
    if(Check.length()<4){    
                             shellMain.open();
         shellLogin.dispose();                    
                        else{
                             JOptionPane.showMessageDialog(null, "Please enter correct username and password");
                             txtUserName.setText("");
                             txtPassword.setText("");
    Basic the problem is with my if statement. If i say Check.length()>4 it always logs in and if i reverse it, it never logs in.
    My database is working fine and is populated. My JDBC code is fine aswell.

    Hey pj,
    you can have as many accounts on your machine as you like and that seem fit to you.
    floba
    PS: Man, I have to type faster as long as V.K. lurks around
    (MN316)
    Message was edited by: floba

  • Question about ssh login warning: Bad protocol version identification

    I set up ssh on my computer according to Tim Haigh's suggestions given here:
    http://discussions.apple.com/thread.jspa?threadID=1674968&tstart=0
    But when I log in from my iPhone, secure.log shows this:
    sshd[534]: Bad protocol version identification 'GET / HTTP/1.1' from 208.54.83.51
    Although I do log in successfully, how can I resolve this error?

    GET / HTTP/1.1
    Looks more like a Web browser handshake, than ssh.

  • Question about email setting: how  do i change the setting so i need to login to check my email. Currently it automatically come to the inbox without the need to log in. Thanks

    Question about email setting: how  do i change the setting so i need to login to check my email. Currently it automatically come to the inbox without the need to log in.

    You don't. Email comes in either by push or when you invoke the email app. Ther is no password except when you first set up the account. If your iPad is not being used as your personal device and you need to shield emails from other users, then don't use the email app.  Instead, use web mail if available from your provider.

  • Basic questions about login

    I got 2 questions regarding to login,
    1. I'm on a 8i DB, when it is shutdown, I want to login again.
    for "sqlplus internal", it says connect to an idle DB.
    for "sqlplus sys/password", it says
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    SVR4 Error: 2: No such file or director
    is this normal? I'm pretty sure my /etc/system is OK and the shutdowns are clean.
    set shmsys:shminfo_shmmax=805306368
    set shmsys:shminfo_shmmin=200
    set shmsys:shminfo_shmmni=200
    set shmsys:shminfo_shmseg=200
    set semsys:seminfo_semmni=4096
    set semsys:seminfo_semmsl=500
    set semsys:seminfo_semmns=4096
    set semsys:seminfo_semopm=100
    set semsys:seminfo_semvmx=32767
    2. For OS user authentication, I understand if the user is a DBA, I would put him in group "dba", then set remote_login_passwordfile=none.
    My question is: how about a regular user? OS authenticaion is only for DBA?
    I may just got myself confused, please give me a hint. thanks.

    I understand now. The problem was the syntax.
    I used
    sqlplus terry/pass as sysdba
    which should be
    sqlplus "..."
    and the second question is clear as well.
    Thanks,
    Terry

  • A quick question about WebDynpro SLD and R/3 with concurrent users

    Hello ,
    I have a very quick question about Webdynpros and SLD connecting to an R/3 system, when you configure a webdynpro to connect to an R/3 system using SLD, you configure a user name and password from the R/3  for the SLD to use. What I would like to know is when I have concurrent users of my webdynpro, how can I know what one user did in R/3 and what another user did? Is there a way for the users of the web dynpro to use their R/3 credentials so SLD can access the R/3? Like dynamically configuring the SLD for each user?
    - I would like to avoid leaving their their passwords open in the code ( configuring two variable to get the users username and password and use these variables as JCO username and password )
    Thanks Ubergeeks,
    Guy

    Hi Guy
    You will have to use Single Sign On to achieve this. In the destination you have defined to connect to R/3 , there is an option to 'useSSO' instead of userid and password. This will ensure that calls to R/3 will be with the userid that has logged into WAS. You wont need to pass any passwords because  a login ticket is generated from WAS and passed on to R/3. The userid is derived from this ticket.
    For this to happen you will have to maintain a trust relation ship between R/3 and your WAS ,there is detailed documentation of this in help files. Configuration is very straight forward and is easy to perform
    Regards
    Pran

  • Question about Customizable Components in JDev 10.1.3.2 version

    Hi,
    I have some some questions about new ADF features.
    1) As we see at the image: http://www.sttb.pl/jakub/customComp.JPG custom component doesn't display polish letters. How to resolve it ?
    2) In command components (button or link) there is enable new value for Action attribute: frame.addContent - what is that and how to use it ?
    3) How to use <cust:showDetailFrame> facets ?
    Regards
    Kuba

    I can help you with 3)
    o Adding Customization to a JSF Application - demonstration
    o WebCenter Tutorial
    o WebCenter Developer's Guide
    Peter

  • Question about navigation in session scope

    Hi.
    I dont know how to resolve a problem or how to focus this stuff.
    I'll try to explain myself.
    Let say I have a page (a.jsf) with several links, all this links navigates to the same page (b.jsf) which shows the results.
    For each link in a.jsf I have attached a bean with a logic, so If I click in link 1 I go to the b.jsf showing data read from the database.table1. If I clik in link2 I go to b.jsf showing data read from database.table2, and so on...
    The beans are in session scope (and must be).
    The first time works ok because I initialize the bean in b.jsf, read data and I show using a selecManyListBox to show it, but if I go back and select another link it goes to b.jsf, but it shows the old data, the data read the first time, because it never calls again the init method.
    Somebody has talked about using an additional bean to control this but once the bean in b.jsf is created I don't know how to call again the init method in beanB (b.jsf)..
    I have attached a very simple project to deploy in eclipse 3.3 and tomcat 6.0. In this example instead of read from database I read from an structure created in memory to simulate this.
    Somebody could take a look and comment something about it.
    http://rapidshare.com/files/197755305/_session-forms.war
    Thanks

    Hi.
    I understand is the same doing in the action method in a button or a commnad, the project is just an example, my real app is a tree, so is not a question about a button or a command, is about the logic being in session scope. I don't know how to face it.
    thanks

  • Basic questions about JAAS capabilities

    I've never used JAAS for authentication or authorization in a Java app before. Can somebody that has (or at least has some experience and knowledge about JAAS) please answer the following couple of basic questions about it? (I know I could probably answer these myself with a few hours of reading.)
    1. Can I use JAAS to restrict the users that can execute specific methods of my code?
    2. If the answer to #1 is yes, is there a way to programmatically determine if a JAAS login user has the permissions to run a method before actually calling that method. In other words, can I ask something like canUserExecute(method) or do I have to just put the call to the method in a try/catch and catch a security exception of some type?
    3. Is it fairly simple to have JAAS authenticate against a Windows Domain or a LDAP server?
    4. Are there programmatic ways to add or edit user information in JAAS?
    Answer to any of these questions are greatly appreciated. I'll even toss a couple of Dukes to the people that answer each question. Thanks in advance.

    You might look at the AfterthoughtSoft-Secure product at http://www.advancedmodelingconcepts.com. It is designed to do just that and will easily allow you to connect to users/group repositories that are in anything from a simple text file all the way up to Kerberos V.
    You can contact the author of the product (me) at bart dot jenkins at gd-ais dot com.
    bart

  • Question about Single Sign On

    Hi Gurus!
    I have a question about the following scenario:
    The login in EP6 is with the NT User (adriano.oliveira), but to access the SAP applications I need to use another User (aoliveira - the size of the NT User is bigger than SAP User length).
    I know this works with user mapping, but the problem is that each user will need to configure his mapping (5000 users). Then I think the option is to use the SAP Logon tickets.
    My doubt is: Is it possible to validate a user id at login (in the EP6 SP10) and generate the client certificate with another user id???
    Important: In the AD (Active Directory), for each NT User id, there is a field with the SAP User id. I could use this field...
    Thanks for any help.
    Regards,
    Adriano

    Adrianao,
    You can maintain reference SAP Server.
    http://help.sap.com/saphelp_nw04/helpdata/en/ed/845896b89711d5993900508b6b8b11/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/0b/d82c4142aef623e10000000a155106/content.htm
    Hope this helps,
    thanks,
    Praveen

Maybe you are looking for

  • Error message in Command line (cannot mount database in EXCLUSIVE mode)

    Hello Experts I'm new in Oracle and trying to connect to my database though SQL command line. After I login as SYS I user I get the message that 'connected to idle instance'. Then I use "STARTUP" to connect to database. Now from my understanding it s

  • Camera-to-computer cable for PowerShot A1100 IS

    need reeplacement camera-to-computer cable for PowerShot A1100 IS -- not available on Canon website -- not available from Office Depot where I bought the camera Solved! Go to Solution.

  • About XML/XSL:Urgent

    Hai , I am developing one module which invloves XML database ,XSL and Javascript. In this I want to transform XML data to XHTML form using XSLT ., I have done this ,(using xsl templates ,In my form two radio buttons one dropdown box and two text boxe

  • How long can Apple photo books be expected to last?

    How long can Apple photo books be expected to last?  Given the type of ink and paper used, what can we expect these books to look like in 10 years?  20 years?  100 years?

  • Quick Selection Tool Crashes CS5?

    Hello, Recently when I've gone to use the Quick Selection Tool I see no "marching ants" and CS5 crashes a couple of seconds after finishing the brush stroke.  I've replaced the graphics card and installed the latest GPU driver.  I uninstalled Photosh