Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple users login  RSS feed

 
Sam Castaño
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, im doing this system, where there are a login page and a profile, when you login you can enter the profile with your info based on your username offcourse, but in my project i can only login with one user, example, i use chrome to login succesfully, then if i open the project in another browser (chrome, explorer, etc) it redirects me to the profile page that i login before in the first browser. Im using SessionScoped, to validate a static variable (which is i think the problem is, but when i use it as non static, the variable wont save), something like, if the username and password exist in the BD you can log in, then the static variable authLogin is true and you can access to the profile.

I tried fix this using anotations, Stateless, Stateful, changing the Scope... but nothing works

Example of code

Validation User


Then the check if the user if logged



I repeat, it works with one user, but i need it for "n" users

I read that maybe i need multi tenant, o managing threads, and i find a lot of theory, but no sample codes that use J2EE

My files...

Login
  Java EE Modules...

Login.ejb
  Source Package
    -->entity
         lot of stuff
    -->session beans
         to persists, edit, etc....

Login.war
   Web Pages
    -->login.xhtml
    -->profile.xhtml
   Source Package
    -->usr
        -->checkUser.java
        -->authBean.java

My server: Glassfish

Thanks, and sorry for the lame english :/
 
Les Morgan
Rancher
Posts: 767
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So are you using sockets? Web server? or are you just logging to your single session and trying to get multiuser... :0

You need to either be using a web server or using sockets and writing your own server.
 
Sam Castaño
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Les Morgan wrote:So are you using sockets? Web server? or are you just logging to your single session and trying to get multiuser... :0

You need to either be using a web server or using sockets and writing your own server.


Hi, web server, and i did it, thanks to @ManageProperty passing a value betwen beans and keep them on session, saving memory, and making it for multiple users, Thanks anyway
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!