alex lamb

Greenhorn
+ Follow
since May 31, 2002
Merit badge: grant badges
For More
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 alex lamb

Hi all,
A simple question. Is it considered bad coding practice if you make a method call and you pass in as a parameter the result of another method call (keeping in mind that that second method call WILL return a boolean for certain). OR are there technical considerations here. The reason I ask is while I was presenting some code at a knowledge transfer, a client seemed to indicate to me that the latter was a big "no no", yet did not explain why.
Thanks for your input !
Alex
ie:
boolean x = someObject.booleanMethod();
if(!anotherBooleanMethod(x)){
// do stuff
}
vs.
if(!anotherBooleanMethod(someValue.booleanMethod())){
// do stuff
}

.. also assume proper code checks that someValue is not null.
Hi all,
This is a super easy question about the format of exam questions. I've seen in different mock exams different formats for check box style questions. Some say choose 1 or 2, others say choose all correct answers.
Does the exam use one, or the other or both ?
I know, it really shouldn't make a difference if we did our studying and know the material but every little edge counts
Thanks for your help once again,
Alex
All,
I agree with James as well. I just ran the example on Tomcat 4.0 . Returns 0 as we all expected it to.
alex
Simon,
That's really quite helpful actually. I figure this is probably not going to be of great importance when studying for the SCWCD exam but it's something I wanted to wrap my head around for my own interest sake. I think I'll just take your explanation for now and look at it a bit later again.
Thanks alot for your help
alex
Hello all,
Can someone please clarify what this means to me please ! I've taken this snippet from the JSP spec.

Once all invocations on the tag handler are completed, the release method is invoked on it. ... The page compiler guarantees that release() will be invoked on the Tag Handler before the handler is relased to the GC


Let's say for a custom Foo tag handler class. It is embedded in a number of pages. The pages are requested in different requests. Does the JSP container create one tag handler class and process all of those requests that need to use the tag handler OR does it create a tag handler object per page and then garbage collect it once the request has been serviced completely ?
Also if I have a single page that uses a number of times the same custom tag, when does it's release() method actually get called and the object garbage collected?
Thanks so much for your insights !
alex
Hi there,
This is a real newbie question so my apologies upfront for any major misunderstandings. What is sendError(int) doing from setStatus(int) that makes it different ?
My understanding is that setStatus simply sets the error code on the response object and then web server will return some default message/page that is simply displayed by the client. right ?
Regarding sendError(int), am I to understand that it sets the status code but in addition to that, sets up the content body and hence potentially throws an IOException ? What is in this content body that we are not specifying and where does it come from ?
Also, on a related note, why does the buffer need to get flushed when sendError(int) is called ?
Many thanks for your answers !
Alex