Sanjay Anand

Ranch Hand
+ Follow
since Apr 03, 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 Sanjay Anand

No, I have not checked with Macromedia. I will do that. Thanks for the suggestion.
I am heartened to know that there isn't a bug in my code at any rate.
Sanjay
18 years ago
Terribly sorry about that.
18 years ago
Thanks Jessica for a good suggestion.
It does not solve my academic question and it is also not usable because my servlet container, Macromedia's JRun, does not support the specs required for the error page functionality.
And, "L" (a name not in keeping with the JavaRanch custom by the way). Here's a code snippet. I hope it formats correctly and is readable.

[ May 31, 2002: Message edited by: Sanjay Anand ]
18 years ago
Hi,
I have a curious problem. More academic at this point than anything else.
I am writing a login servlet.
We are required by our client to not allow the user / customer to see any exceptions at all. Users need simply be redirected to a 'temporary difficulties' html page.
So, in addition to other checks, we've put in a method-wide try - catch in the doPost method that logs the error and redirects the user in case something untoward occurs.
Now, in updating and tweaking the code, I made an error in logic that was caught only in runtime. I was trying to call methods for an object before instantiation. No problem. It is now fixed.
But the question is, why was the runtime NullPointerException not caught? Why did it spit up to the browser level immediately? I even tried catching the NPE explicitly, to no effect.
Any thoughts on this?
I can post code snippets if anyone thinks them relevant.
Sanjay
18 years ago
In an earlier discussion [http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=11&t=002344], Tim Holloway suggested that:

One possible resolution to that might be to use the EJBs as an interface and have them defer to a common resource, though that's really just pushing the problem a layer deeper.


Tim was addressing the problem of 'version creep' versus synchronization of business logic across multiple apps.
But we are considering this as a standard since it fits our general model of code management to have a centralized location for all business logic.
How viable is this solution? Does this create any performance or deployment issues? Or does it violate any fundamental J2EE guideline?
I would appreciate any feedback you could give me.
Thank you
Sanjay
Thanks a lot for your thoughtful reply.
Apologies for being late in my reply.
Your comment sent me back to see if there were any scoped relationships impacted by the structure. But, at least for now, scope is not really an issue as far as I can tell. Perhaps access scope will become an issue as our system evolves.
But perhaps I misunderstand what you mean by scope, but if I organize the classes according to 'proximity' to the classes that need to use them, will that not be a functional division? So that all signin-related classes, for example, sit in one package? And does that not therefore impact the 'modularity' of the object-oriented design?
I could not locate the article by Ken Arnold.
Anyway, glad to know the package makes at least *some* sense though I guess I am confused about the scope issue in general.
Thanks once again.
Sanjay
18 years ago
Greetings.
I write to ask for feedback on a package I have been assigned the task of designin. I attach it below. Is it too involved? That is one question. Does it follow established conventions and norms? That is the next question.
This is, by the way, a 'real world' library of applications. I am simply restructuring and updating this.
I would appreciate any comments.
Thanks
Sanjay Anand
18 years ago
Yes, I have cleared the cache. In fact, that is necessary as it is only the first time the certificate is loaded that the invalid site certificate warning pops up.
An interesting development is that the latest version of IE does not have this problem. Even with the warning, the data goes through. So it seems to have been a browser problem.
But yes I have posted this on the Allaire support forum.
But I still wonder why would a warning cause the request object to get lost.
Sanjay
[This message has been edited by Sanjay Anand (edited September 17, 2001).]
19 years ago
i am still struggling with this problem.
i have narrowed down the problem a bit. there seems to be something up with the ssl interaction. we use a single security certificate from verisign for our production and development sites. in our development sites, it generates an error because the site url does not match the license. whenever this occurs, the servlet gets no data. if i can bypass this by fiddling with the domain, the error disappears.
what could be going on?
again, would appreciate any input.
sanjay
19 years ago
Wednesday, September 12, 2001 1:37 PM


hi all,
i am having a very odd problem.
using jrun3.1, i am developing a signin servlet that takes a number of paramenters, some 'posted' some 'gotten'.
intermittently, without any particular pattern, about 20-25% of the time, the servlet does not get the posted data (gets nulls instead of strings) though the posting page itself has a javascript that ensures nonnull fields, checks for '@', etc.
the only pattern to this madness is that immediately after such an incident, it always works fine.
any clues?
all help and input is deeply appreciated.
sanjay


19 years ago
Thanks, Jamie for the input. Your solution, however, throws a nullpointer exception when you try to get a null result from the result set and then append it to a StringBuffer. It was precisely this exception that sent me scrambling to check for null through comparison.
Sanjay

Actually in this snippet I'm checking to see if the resultset is null or not. I've been told that the comparison:
if (CustResults.next())
actually moves the resultset cursor up one count and you therefore lose the first set of data. I have not confirmed this and simply started implementing the suggested solution of moving through the resultset twice.
It seems inelegant but it does work. Any other suggestions?
Thanks for the renewed attention to this topic. I have since cleaned up other parts of my code and actually moved to JRun rather than Tomcat and no longer have this problem
Sanjay
Please explain how I might do that?
Thanks in advance.
Sanjay
19 years ago
Dear gurus and colleagues,
I have a need to test whether cookies are enabled or not in the browser. Setting a cookie and then getting it did not work because the cookie seems to be visible only 'downstream' from the servlet. So looking through the ever so useful JavaRanch archives I found a solution.
It works for Internet Explorer but not for Netscape (no matter which version).
Any ideas?


19 years ago
yes it helps a lot. thank you much.

sanjay
19 years ago