if (! request.isAuthorized()) {
throw new InvalidSessionException("Invalid Session! <br><a href=\"" + Constants.SYSTEM_LOGIN + "\">Try again</a>");
}
// Facade calls must come before using out
IteratorDsk repTP = facade.getSpecialityList();
out.println("Queries - Medical Speciality information");
out.println("<body><h1>Queries:<br>Querie about medical specialities</h1>");
out.println("<p>Choose a speciality: </p>");
out.println("<form method=\"POST\" action=\"http://"+ Constants.SERVLET_SERVER_PATH+ "HWServlet\">");
out.println("<input type=\"hidden\" name=\"operation\" value=\"UpdateMedicalSpecialitySearch\">" );
out.println("<div align=\"center\"><center><p><select name=\"specialityCode\" size=\"1\">");
if (repTP == null || !repTP.hasNext()) {
out.println("</select></p></center></div>");
out.println("<p><font color=\"red\"><b> There isn't any medical speciality.</b></font></p>");
} else {
MedicalSpeciality speciality;
do {
speciality = (MedicalSpeciality) repTP.next();
out.println("<option value=\"" + speciality.getId() + "\"> "
+ speciality.getDescricao() + " </OPTION>");
} while (repTP.hasNext());
repTP.close();
out.println("</select></p></center></div>");
out.println(" <div align=\"center\"><center><p><input type=\"submit\" value=\"Search\" name=\"B1\"></p></center></div></form>");
}
out.println(HTMLCode.closeAdministrator());