Brian Blesbok

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

Recent posts by Brian Blesbok

try running the code in the top window that defined the frameset.
you could define a method in the top window called closeMe() and in that method you would have:
20 years ago
have a look at what you have posted here.
You are expecting us to try to tell you why you are getting an NPE in a section of code that you havent even given us.
First of all, the first statement will give an NPE if sort does not exist on the request, second, the 2nd statement is the *same* as the first.
Post the whole code if you want help
[This message has been edited by Brian Blesbok (edited September 14, 2001).]
20 years ago
if the person has refreshed the data, then this will have come from the server, and then the server will be able to know about it... ie: the servlet will be run to do this?!?!?!
20 years ago
you can use:
in the header of each and every servlet page - include it in a js file if you want... that way, when a user presses the back button, on trying to load the provious page, the browser goes forward one ie: stays on the current page.
In IE this works sweet, and there is no page flicker really -but NutScrape has a bit of a flicker - but both work.
This is the only way I have found of disabling the back.
Another way, is to code your app so that it handles the situation where someone has pressed the back button. always code for the worst case scenario -if a user can break it, they will - and complain they will also!!
20 years ago
Hi everyone,
Just wondering if there is a way of getting how many bytes an object takes up - I'm thinking in terms of session managment issues and user management - and how I can plan (on paper) how many users my app will be able to handle...?!?!?
Cheers for the anticipated help!
20 years ago
i think this is something to do with which HTTP protocol the browser uses and which one the server expects... ie: 1.0 or 1.1...
Now one of these uses persistent connections and this could be the problem... I know IE5 has a switch in the config for which protocol to use - try browsing the servlets with 1.0 and then 1.1 and see if its different...
20 years ago
Bill - I find that using the session and its implications isnt explained very well in any book that i've read so far... havent read yours so cant comment as yet!
For example: Do I *need* to do a putValue after I've done a getValue and then modified that object? Intuitively, you would think so, but as the local is just a ref to the original one, which is still in the heap, then it doesnt seem to be needed...
MyObject myobject = new MyObject(); // create my own object
myobject.setMyProperty("some_value"); // set some property
session.putValue("my_key", myobject); // store it in the session
myobject.setMyProperty("some_new_value"); // change a property
//session.putValue("my_key", myobject); // this isnt needed
System.out.println(((MyObject)session.getValue("my_key")).getMyProperty()); // returns 'some_new_value'
So am I right in saying that I only need do a putValue *after* I've created a 'new' object, and not after i've done a getValue and modified it?
20 years ago
hi - thanks for the reply!
the session ID are the same in both servlets, i do a req.getSession(false) in both servlets and handle the event where this returns null etc... Would you ever expect the session to not be the same?
I have re-written the code to only put the value in the session once, so i now have 'one putvalue and many getvalues' for this one variable. OK - this was originally bad coding - but its surprised me that it caused a problem.
I dont want to use synchronised anywhere if possible - this particualar varaible i use is very heavily used in my system...
I use synchronized for starting my connection pool up -so that only one servlet can do this etc...
i'll be testing my code tomorrow to see if this has helped...
20 years ago
We build a single framed page by running two servlets - button bar and data frame...
Both servlets access the same session.
I'll try to explain the problem:
Two Servlets - call them AA and BB running concurrently - like when building a page using two servlets...

AA runs and does a putValue in the session, then calls a getValue later on in the servlet... all OK so far... servlet is still running...

Meanwhile, servlet BB starts up and does the same putValue on the same key name, then does a getValue later on in the servlet... all OK so far...

Now servlet AA which hasnt finished yet and is still in the doGet, does a getValue on the session on that original key name, and it comes back null... but at seemingly random times - but for arguements sake, say its once every 100 attempts...
So what is going on? The key/value pair that I'm putting in the session is simply a String/String pair.
Do people think that the fact that the 2nd servlet has done a putValue has somehow chnaged the reference to the value, and so the 1st servlets ref point is now null?
20 years ago