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 subject | updated |
4432 | Java 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 |
3997 | Servlet 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 |
3044 | Changing 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 |
2652 | Reading 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 |
1909 | javax.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
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
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,
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.