wael chatila

Greenhorn
+ Follow
since Jul 14, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by wael chatila

the probabilty is that you already have it!
sun.misc.BASE64Decoder
sun.misc.BASE64Encoder
-W
18 years ago
I think Marcos is right. In real life you wont have this problem. Probably and somehow your browsers sends the same cookie.
If you still want to completely eilimante this problem you can do some tricks like put in a hidden field, or when you call setAttribute("UserID", XxXX), first call getAttribute("UserID") to see if it already exists.
When i took a look in your code i noticed that you set up a new connection for EVERY reqest. To improve performance you should use connection pooling. Connections should be thread safe.
I like your last statment of "code"
//////////////THANK GOD THIS PAIN IN THE ASS IS DONE!!!
-W
18 years ago
Good point Marcus, i was just about to test this:
Here is the code
doGet(...)
{
...
HttpSession s=req.getSession(true);
if (s.isNew())
out.println("NEW");
else
out.println("OLD");
}
Results:
* launced up a new browser: NEW
* lanched up a new window (CTRL-N): OLD
-W
18 years ago
How and where do you call HttpSession.putValue()?
18 years ago
Here is a good free book about java in general http://www.mindview.net/Books/TIJ/
18 years ago
Holas!
I've encounted a similar problem while i was testing with several browsers on the same machine.
I was using the session api which i presume you do aswell. My bug was due to uncareful tracing of the different sessions. Maybe you want to take a look there...
regards
wael
PS I would be intressting to see your code!
18 years ago
The easiest thing to do is if your database support batch mode operations.
With MySQL, for example (which is free for download) u can simple write this at the prompt:
mysql -h yourhost -u userid -p < your.txt.file
Enter password; ****
If you need to do this directly from ur java app, the easiest you solution is to spawn a new shell with the this argument:
mysql -h yourhost -u userid -pYoUrPaSsWoRd < your.txt.file
Salam