Ye I been trying this - and in theory it would be in reverse - it still failed to work.
If I explain what I am trying to achieve hopefully it will make more sense.
If you take the code I have already provided, compile and run it - you will find the Template (although not defined in web.xml) is actually doing all the work in the background for Contact.java.
Contact.java is simply producing what title/page content to show within Template.
The theory and it does appear to be working - is for Template to be exactly this a Template for any Servlet I wish to create - It does all the required tasks I need within all my servlets - it returns the username,the ip address and if not logged in will redirect them to log in page.
I expect the Template to only have the top part of my Servlet code - meaning checking username,authentication ip etc. This is what is required from all or any new servlet that is to go live.
The Contact alongside with newservlet1 newservlet2 etc is supposed to extend Template and then look for specific doPost/doGet actions and action them accordingly.
So in theory in Contact.java
I have already got it to generate the Contact form page - it sends back title and page name and then Template.java loads up the page and shows headers/footers title etc.
The next bit which is not working is for me to verify the form parameters which is where I am stuck at since I can not seem to pass values back from Template.