throw new FenixActionException("Unable to identify user as a teacher.");
ActionErrors actionErrors = new ActionErrors(); actionErrors.add( "finalWorkInformationForm.unexistingTeacher", new ActionError("finalWorkInformationForm.unexistingTeacher")); saveErrors(request, actionErrors); return mapping.getInputForward();
	public ActionForward showTeacherName(		ActionMapping mapping,		ActionForm form,		HttpServletRequest request,		HttpServletResponse response)		throws FenixActionException {		IUserView userView = SessionUtils.getUserView(request);		DynaActionForm finalWorkForm = (DynaActionForm) form;		String alteredField = (String) finalWorkForm.get("alteredField");		String number = null;		if (alteredField.equals("orientator")) {			number = (String) finalWorkForm.get("responsableTeacherNumber");		} else if (alteredField.equals("coorientator")) {			number = (String) finalWorkForm.get("coResponsableTeacherNumber");		}		if (number == null || number.equals("")) {			if (alteredField.equals("orientator")) {				finalWorkForm.set("orientatorOID", "");				finalWorkForm.set("responsableTeacherName", "");			} else if (alteredField.equals("coorientator")) {				finalWorkForm.set("coorientatorOID", "");				finalWorkForm.set("coResponsableTeacherName", "");			}			return prepareFinalWorkInformation(				mapping,				form,				request,				response);		}		Object[] args = { new Integer(number)};		InfoTeacher infoTeacher;		try {			infoTeacher =				(InfoTeacher) ServiceUtils.executeService(					userView,					"ReadTeacherByNumber",					args);			if (infoTeacher == null) {				throw new FenixActionException("Unable to identify user as a teacher.");			}		} catch (FenixServiceException e) {			throw new FenixActionException(e);		}		InfoTeacher teacherUser = getTeacher(userView);		if (alteredField.equals("orientator")) {			finalWorkForm.set(				"orientatorOID",				infoTeacher.getIdInternal().toString());			finalWorkForm.set(				"responsableTeacherName",				infoTeacher.getIdInternal().toString());			request.setAttribute("orientator", infoTeacher);			if (infoTeacher				.getIdInternal()				.equals(teacherUser.getIdInternal())) {				finalWorkForm.set("role", "responsable");			}		} else {			if (alteredField.equals("coorientator")) {				finalWorkForm.set(					"coorientatorOID",					infoTeacher.getIdInternal().toString());				finalWorkForm.set(					"coResponsableTeacherName",					infoTeacher.getIdInternal().toString());				finalWorkForm.set("companionName", "");				finalWorkForm.set("companionMail", "");				finalWorkForm.set("companionPhone", "");				finalWorkForm.set("companyAdress", "");				finalWorkForm.set("companyName", "");				finalWorkForm.set("alteredField", "");				request.setAttribute("coorientator", infoTeacher);				if (infoTeacher					.getIdInternal()					.equals(teacherUser.getIdInternal())) {					finalWorkForm.set("role", "coResponsable");				}			}		}		return prepareFinalWorkInformation(mapping, form, request, response);	}