Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
20.9.2014 - We have just updated our course layouts and descriptions and added our 2015 schedule.


Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Java module J901
Servlets
Exercises, examples and other material relating to training module J901. This topic is presented on public courses Learning to Program in Java, Java Bootcamp, Java Programming for the Web

Web applications in Java can be provided by Servlet classes running in a container on a web server. In this module, you'll learn how to write simple servlets that allow web users (whether or not they have Java in their browser) to interact with your Java applications.

Related technical and longer articles
Sessions in Servlets

Articles and tips on this subjectupdated
3997Servlet v JSP (Java Server Page). What is the difference?
A servlet is a web program that generates output (normally HTML) and returns it to a browser. A JSP (Java Server Page) is a page of HTML ... with some extra bits of code where programatic elements are added as it's returned to the browser So on the surface, it looks like there's a fundamental difference. ...
2013-02-07
 
3044Changing a Servlet - more that just editing and compiling
If you're going to modify a servlet, you'll need to edit and recompile the classes that you're changing - and chances are that will include the main application class. Which means you need to have access to the source. Not a problem if you're a developer of the product, but could be an issue if it's ...
2010-11-12
 
2652Reading and writing cookies in Java Servlets and JSPs
Do you want to check (and perhaps set) cookies within a Java Servlet? I was looking around for good, straightforward examples today but found that most of the published code is only snippets rather than complete examples, or is over-complex for what should be a simple demo. First - do you really want ...
2010-02-26
 
1909javax.servlet cannot be resolved - how to solve
Two common problems in compiling Servlets for use within a Tomcat container ... PROBLEM: My Java Compile of a Servlet says "javax.servlet cannot be resolved" For example: [trainee@easterton sources]$ javac Smallest.java ---------- 1. ERROR in Smallest.java  (at line 2)    import javax.servlet.*;           ^^^^^^^^^^^^^ The import javax.servlet cannot be resolved ---------- 2. ERROR in Smallest.java  (at line 3)    import javax.servlet.http.*;           ^^^^^^^^^^^^^ The import javax.servlet cannot be resolved ---------- 3. ERROR in Smallest.java  (at line 5)    public class Smallest extends HttpServlet {                                  ^^^^^^^^^^^ HttpServlet cannot be resolved to a type ---------- 4. ERROR in Smallest.java  (at line 9)    public void doGet(HttpServletRequest request,                      ^^^^^^^^^^^^^^^^^^ HttpServletRequest cannot be resolved to a type ---------- 5. ERROR in Smallest.java  (at line 10)    HttpServletResponse response)    ^^^^^^^^^^^^^^^^^^^ HttpServletResponse cannot be resolved to a type ---------- 6. ERROR in Smallest.java  (at line 11)    throws IOException, ServletException                        ^^^^^^^^^^^^^^^^ ServletException cannot be resolved to a type ---------- 6 problems (6 errors)[trainee@easterton sources]$ SOLUTION: ...
2008-11-26
 
Examples from our training material
Lifeanswer.java   Basic Servlet - simple calculation and a visit counter
Maryland.java   Checking and setting cookies in a Servlet
Memo.java   Linking requests together via a session in a servlet
Noah.java   A simple servlet, and how to modify it
svl.html   Servlet demo - HTML form
svl_right.java   Servlet to read form and echo
symdyn.html   Dynamic operation of a Servlet
Background information
This module is available under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
What is a Servlet?.
Running the server.
A first servlet.
The HTML form.
The servlet.
Reusing a servlet.
Form and results in same window.
Interactive form.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Java,Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/J901.html • PAGE BUILT: Thu Sep 18 11:03:17 2014 • BUILD SYSTEM: WomanWithCat