friso jonge

Ranch Hand
+ Follow
since Aug 06, 2002
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 friso jonge

The above method in httpsession, does it clear its resources as well, (bascally setting the removed object to null) or is the attribute itself still available ?
thanks,
friso
17 years ago
JSP is the right answer. Do not be fooled to believe jsp is a right answer as well. Some containers do treat this as a good working value as well.
right answer is D.
Like said above, the container creates a pool of servlet instances. Since the stringbuffer is an instance variable (and not a class static variable), it does exist for each instance. So the addresses are added to the stringbuffer instance of the pooled resource. Not all requests use the same servlet instance !!
has anyone experienced corrupted jar files. What could be the reason for corruption and how to prevent this happening.
17 years ago
or try jboss, if you are adventureous
struts builds on the mvc pattern, which is in this exam, be it marginally. Therefore, do this exam first, then concentrate on the next step
can anyone please answer this, since this is what the book says. "mapping can be used for linking to classes outside the web-inf directory."
so is that true ??
it should have a low rating. There are loads of errors in the book, and just creating an errata does not do it for me. I bought that book 2 months ago, but a lot of little things are not mentioned in there
- load on startup
- findAttributes
- pagecontext (good explanation at least)
- errors in explanations
- errors in questions and answers
these are just from the top of my head, but believe me there are loads more errors. DONT BUY THIS BOOK
i'm still trying to use this book, since i do not want to spend another �40 on a book. But i have to do all the web test exams with more care, since it more of a learning excercise than an excercise to see how good i am.
hmmm, i just read the following in this discussion thread.
Implementing the SingleThreadModel inerface makes a Servlet Threadsafe
This is not true !!! STM helps towards thread safety and assures you that only one thread at the time accesses this servlet instances' service method. However containers can create more than one instance of each servlet, or create a pool of instances. If you have a pool of instances, then all the instances share the same static variables. This makes that static variable not threadsafe.
Therefore implementing the STM alone does not make the servlet threadsafe. You have to synchronize access to your statics.
i would like to see an answer to the jsp-threadsafe remark above my reaction.
cheers,
friso
hi,
answer to both of your questions....
http://jakarta.apache.org/struts/index.html
cheers,
friso
17 years ago
hi,
please take out your public void runTest(); method altogether. Junit will call all the methods starting with test...... automatically.
cheers,
friso
17 years ago
sorry, i think i found the answer myself....
public abstract class HttpServlet
extends GenericServlet
implements java.io.Serializable
Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these:
also the class in question only has a post and not a get method which is requested...
again sorry
Hi all,
I have a question about the javaranch scwcd mock exam as you can see below. I think i have seen it before but now i cannot find it. What is the answer and why ?
i think it does not compile, but javaranch explains An error page is returned from the Server.

package com.javaranch;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class PostServlet extends HttpServlet
{
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>\n <body>\n");
out.println(" <h2>\n Hello World\n </h2>\n");
out.println(" </body>\n</html>\n");
out.flush();
out.close();
}
}
What is the result of compiling the above Servlet and accessing it by typing:
"http://www.javaranch.com/servlet/com.javaranch.PostServlet";
into the address field of a browser
dont take the sybex book. (ISBN-0-7821-4091-2, that will hopefully teach them to publish sheit books)
It has so many errors, not just in questions and answers section, but also in the documentation chapters itself. Just take a look at 95 % of my posts and you will find out which errors.
sorry for the language, but save yourself some troubles and dont buy sybex for web developer certification
(guys from sybex, this is an open invitation to send me a free updated version, since i have corrected so many errors
which of the following best describes an example of url rewriting
a) out.println("<input type=hidden name='name' value='billybob'"> ;
b) out.println("<form action='/servlet/testservlet/billybob' method='post'>");
c) HttpSession session = req.getSession();
d) session.addAttribute("name", "billybob");
e) none of the above
book answer:
B - URL rewriting consists of adding data to the URL The receiving servlet can then extract the additional information to utilize the data.
my answer would be:
E.
b is not url rewriting since that should have been done programmatically and this is hardcoded.
I do agree to a point that B can be url rewriting if the writer of this servlet always wants to add billybob as extra pathinfo. But wouldn't that be pointless and therefore a complete wrong example ?