Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))

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 J906
Servlets in More Detail
Exercises, examples and other material relating to training module J906. This topic is presented on public courses Learning to Program in Java, Java Bootcamp, Java Programming for the Web

If you're writing a substantive web application, you're likely to have a number of visitors to your site at the same time, with each of them calling up a series of screens. In this module, we examine parameter handling, session control, and the persistence of servlets from one call to the next.

Related technical and longer articles
Sessions in Servlets

Articles and tips on this subjectupdated
4432Java web application for teaching - now with sessions and clustering / load balancing demonstrations
I regret naming "latmjdemo" with that name when I prut together a web application for the Java version of our web deployemnt course. The nameing isn't random: • L - Linux, the operating system • A - Apache - the Apache httpd web server that's commonly used to front web sites • T - Tomcat ...
2015-02-19
 
4431A Java servlet that is also a stand alone program. And a server that is also a web client.
I've been teaching the fundamentals of Java (a private 4 day course) to a number of groups over the past few weeks - each time tailoring the course towards the projects that the delegates (within a large organisation) will be using it for, and also tailoring to suite the background of the delegates. ...
2015-02-19
 
3293Distributing the server load - yet ensuring that each user return to the same system (Apache httpd and Tomcat)
Have you ever tried to sort out a complex situation with a supplier - perhaps something's gone wrong with your electic and gas bills (as happened with us a couple of months ago, when our gas payment got credited to our electic account with the same company). You get on the phone, and the initial person ...
2011-05-18
(longer)
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
 
2717The Multiple Inheritance Conundrum, interfaces and mixins
Should an OO programming language support "multiple inheritance"? Let's define multiple inheritance first - starting from simple (single?) inheritance. (Single) Inheritance. I don't want to have to define each type of thing ("class of object") from scratch, so I'll define once class as being based ...
2010-04-13
 
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
 
2183Servlet life cycle, and Java Servlet variable scope
If you write a 'traditional' program and run it ... then it is cleared from memory when you finish running it. It does its job then exits. And so it is with a java program that you run from the command line under the java command. But if you're running a web server, where lots of users all call up ...
2009-05-16
 
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
 
1550Java (JSP and Servlet examples) live on our server
On our Java Programming for the Web and Deploying Apache httpd and Tomcat courses, we provide a ready-written demonstration that includes simple web pages, a basic JSP, JSPs with tag libraries, and a couple of Servlets - with some calling up data from a MySQL database. I have uploaded the examples so ...
2008-02-27
 
1495Single login and single threaded models - Java and PHP
On Apache Tomcat courses, I find myself explaining "single login" models and on some Java courses I explain single threaded models. In both cases, there are times that newcomers to the technologies ask "does it matter". Answer - for a small and quiet application suite, probably not - but as the ...
2008-01-08
 
479New servlet from old
Check list - how to modify a Servlet and install it under a new name on your Tomcat server. This scheme assumes that you're working at a machine that has Java installed, but doesn't have its own copy of Tomcat and all the extras (why would it - it's your development machine and not the server!) 1. ...
2006-06-05
 
Examples from our training material
Barman.java   Simple Session Tracking
ByName.java   Comparator class for Stations (transport demo)
Framework.java   Main servlet / stand alone program (transport demo)
HelloServlet.java   Hello Servlet World
Landlord.java   Simple Session Tracking servlet reporting all users
MyStream.java   MySteam web or file reader (transport demo)
PubWatch.java   Session Tracking for Cluster and Load Balance demos
Station.java   Station class (transport demo)
web.xml   Example URL to servlet class mappings
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from [here].
Topics covered in this module
Introduction.
What is a Servlet?.
How do Servlets fit into the scheme of things?.
What alternatives are there to servlets?.
Servlet Engines.
Java Class Structure.
Data Interface.
A first servlet.
Reading from a form.
At a higher level.
Get v Post.
The life of a servlet.
Initialisation.
Destruction.
Maintaining State.
Session Objects.
Rewriting URLs.
Hidden fields.
Programming techniques.
Webifying output.
Keeping code and pages separate.
State Diagrams.
Other facilities of servlets.
Multiuser Servlets.
Servlet Descriptions.
Cookies.
Sessions in Servlets.
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,Ruby, Lua, 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.


You can Add a comment or ranking to this page

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

PAGE: http://www.wellho.info/resources/J906.html • PAGE BUILT: Sun Oct 11 14:50:09 2020 • BUILD SYSTEM: JelliaJamb