protected void showMainScreen (HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		// set the encoding, otherwise database is encoded wrongly 
		request.setCharacterEncoding("UTF-8");
				
		HttpSession session = request.getSession();
		AdminUnitVM formData = (AdminUnitVM) session
				.getAttribute("formData");
		
		// if no viewmodel in session, then normally this is first call through
		// get
		// so check get parameters and populate viewmodel with data from dao
		if (formData == null) {
			session.removeAttribute("errors");			
			formData = processGET(request, response);			
		} else {
			// formData was there, so this is post!
			if (cancelWasPressed(request, response)) {
				return;
			}
			
			formData = updateViewModelFieldsForDB(request, formData);
			
			// do some simple validation - so at least code and name are set
			// (and should be unique)
			List<String> errors = getValidationErrors(request);
			if (!errors.isEmpty()) {
				session.setAttribute("errors", errors);
			} else {
				session.removeAttribute("errors");
			}

			// AdminUnitMaster (0-"---": no master)
			System.out.println("AdminUnitMaster_adminUnitID:"
				+ request.getParameter("AdminUnitMaster_adminUnitID"));
			
			formData = updateUnitsType(request, formData);			
			formData = updateUnitsMaster(request, formData);
			
			// now the tricky part - scan through several possible submit
			// buttons: which button was clicked?
			Enumeration<String> paramNames2 = request.getParameterNames();			
			while (paramNames2.hasMoreElements()) {
				String paramName = paramNames2.nextElement();
				
				if (paramName.startsWith("RemoveButton_")) {
					formData = removeSubordinate(formData, paramName);					
				}
				if (paramName.equals("AddSubordinateButton")) {
					formData = addSubordinate(formData, request);
				}

				// global save and exit, no validation errors
				if (paramName.equals("SubmitButton") && errors.isEmpty()) {
					submitToDataBase(formData, response);
					return;					
				}			
			}
		}
		
		//At this point we stay on present screen
		
		// save the viewmodel for jsp dispatcher into session
		session.setAttribute("formData", formData);
		
		// call the dispatcher
		request.getRequestDispatcher("AdminUnitScreen.jsp").forward(
				request, response);
	}