Re: Code Q.
You kight want to get some decent example code,then edit that to get you started. If you have either of the O'Reilly books (servlet programming or JSP) then download thier example code. The JSP code certainly works just by unpacking under tomcat. You can then just edit/view thier simple examples to start getting to know it. For basic Java tutorial, Bruce Eckels has an online book called Thinking In Java - which you can download for free. sam - Original Message - From: "Purcell, Scott" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 10:21 PM Subject: Code Q. Hello, I am learning JSP and have done quite a few examples from the Core Servlets and JSP book. I apologize for asking this q here, but I am trying to learn Tomcat and put my whole picture together, and I figured that the people on this line, would probably know what these lines mean. Anyway, I keep typing these few lines but really don't have a grasp of what they are doing. I would really like to understand in a 'Laymans' fashion what I am doing and what these lines do. public class Hello extends HttpServlet { //I am assuming that the class Hello, that I am creating // is extending HttpServlet class? // but what does the extends really mean? public void doGet(HttpServlet request, HttpServlet response) throws ServletException, IOExcedption; // It looks like I am creating? or calling? a method here. And am I passing it the HttpServlet class? I am very confused on this, and would enjoy hearing from someone that wouldn't mind going over that with me. Thanks very much, Sincerely Scott
RE: Code Q.
Scott - One thing that the Core Servlets book doesn't do well is explain Java basics, like what does extends mean or how do method/class declarations work. It assumes that knowledge. I found Sams "Teach Yourself Java in 21 Days" really helpful; it contains a lot of basic java information that would address your questions pretty well. You might want to look at the webapps\examples\web-inf\classes directory of tomcat for some good basic examples of what servlets look like. Tim -Original Message- From: Purcell, Scott [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 5:22 PM To: '[EMAIL PROTECTED]' Subject: Code Q. Hello, I am learning JSP and have done quite a few examples from the Core Servlets and JSP book. I apologize for asking this q here, but I am trying to learn Tomcat and put my whole picture together, and I figured that the people on this line, would probably know what these lines mean. Anyway, I keep typing these few lines but really don't have a grasp of what they are doing. I would really like to understand in a 'Laymans' fashion what I am doing and what these lines do. public class Hello extends HttpServlet //I am assuming that the class Hello, that I am creating // is extending HttpServlet class? // but what does the extends really mean? public void doGet(HttpServlet request, HttpServlet response) throws ServletException, IOExcedption; // It looks like I am creating? or calling? a method here. And am I passing it the HttpServlet class? I am very confused on this, and would enjoy hearing from someone that wouldn't mind going over that with me. Thanks very much, Sincerely Scott
RE: Code Q.
Hello, There are many good books on java basics. I personally like the Core Java 2 series. Start with volume 1 of course. Getting comfortable with object oriented programming is essential to developing an understanding of how java is used. I also highly recommend visiting www.javaranch.com which is a very friendly place. :0) Make sure to read "how I taught my dog polymorphism" and visit the saloon regularly. Good luck, Craig Sun Certified Java Programmer -Original Message- From: Tim Coultas [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 19, 2001 5:47 AM To: [EMAIL PROTECTED] Subject: RE: Code Q. Scott - One thing that the Core Servlets book doesn't do well is explain Java basics, like what does extends mean or how do method/class declarations work. It assumes that knowledge. I found Sams "Teach Yourself Java in 21 Days" really helpful; it contains a lot of basic java information that would address your questions pretty well. You might want to look at the webapps\examples\web-inf\classes directory of tomcat for some good basic examples of what servlets look like. Tim -Original Message- From: Purcell, Scott [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 5:22 PM To: '[EMAIL PROTECTED]' Subject: Code Q. Hello, I am learning JSP and have done quite a few examples from the Core Servlets and JSP book. I apologize for asking this q here, but I am trying to learn Tomcat and put my whole picture together, and I figured that the people on this line, would probably know what these lines mean. Anyway, I keep typing these few lines but really don't have a grasp of what they are doing. I would really like to understand in a 'Laymans' fashion what I am doing and what these lines do. public class Hello extends HttpServlet //I am assuming that the class Hello, that I am creating // is extending HttpServlet class? // but what does the extends really mean? public void doGet(HttpServlet request, HttpServlet response) throws ServletException, IOExcedption; // It looks like I am creating? or calling? a method here. And am I passing it the HttpServlet class? I am very confused on this, and would enjoy hearing from someone that wouldn't mind going over that with me. Thanks very much, Sincerely Scott
Code Q.
Hello, I am learning JSP and have done quite a few examples from the Core Servlets and JSP book. I apologize for asking this q here, but I am trying to learn Tomcat and put my whole picture together, and I figured that the people on this line, would probably know what these lines mean. Anyway, I keep typing these few lines but really don't have a grasp of what they are doing. I would really like to understand in a 'Laymans' fashion what I am doing and what these lines do. public class Hello extends HttpServlet { //I am assuming that the class Hello, that I am creating // is extending HttpServlet class? // but what does the extends really mean? public void doGet(HttpServlet request, HttpServlet response) throws ServletException, IOExcedption; // It looks like I am creating? or calling? a method here. And am I passing it the HttpServlet class? I am very confused on this, and would enjoy hearing from someone that wouldn't mind going over that with me. Thanks very much, Sincerely Scott
Re: Code Q.
Scott, You're asking some straight-forward Java questions that might be better addressed in one of the news groups (comp.lang.java, for example)--if you're not familiar with newsgroups check out www.deja.com (currently held hostage by google, but hopefully working soon). In the code, you're defining a class called Hello which is a subclass (also called a child) of the HttpServlet class. Extends is a Java keyword meaning that your class (Hello) inherits the functionality of the HttpServlet class--Object Oriented concepts like Inheritance would be thouroughly explained in a Java text book. It looks like your doGet method is miss-copied (adding to your confusion). You are, in fact, defining a method--one that will eventually be called by the Tomcat server. If you look closely at the book you're reading, you'll probably see that it actually takes HttpServletRequest and HttpServletResponse (not just HttpServlet). Servlets are kind of complicated--you might find it easier to start with some more basic Java and work up to Tomcat and servlets. Cheers, and good luck, Eric From: "Purcell, Scott" Reply-To: [EMAIL PROTECTED] To: "'[EMAIL PROTECTED]'" Subject: Code Q. Date: Wed, 18 Apr 2001 16:21:51 -0500 Hello, I am learning JSP and have done quite a few examples from the Core Servlets and JSP book. I apologize for asking this q here, but I am trying to learn Tomcat and put my whole picture together, and I figured that the people on this line, would probably know what these lines mean. Anyway, I keep typing these few lines but really don't have a grasp of what they are doing. I would really like to understand in a 'Laymans' fashion what I am doing and what these lines do. public class Hello extends HttpServlet { //I am assuming that the class Hello, that I am creating // is extending HttpServlet class? // but what does the extends really mean? public void doGet(HttpServlet request, HttpServlet response) throws ServletException, IOExcedption; // It looks like I am creating? or calling? a method here. And am I passing it the HttpServlet class? I am very confused on this, and would enjoy hearing from someone that wouldn't mind going over that with me. Thanks very much, Sincerely Scott _ Get your FREE download of MSN Explorer at http://explorer.msn.com