1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
<%@ page import="java.util.*, GestionFichiers.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SCE</title>
</head>
<body>
<h1>Connection à l'hôte</h1>
<hr />
<script language="JavaScript">
function choixURL(){
var objForm = document.getElementById('formConnection');
var boutOnClick=document.getElementById('cache').value;
if(boutOnClick=="Envoyer")
objForm.action = "connection.jsp";
if(boutOnClick=="Annuler")
objForm.action = "index.jsp";
if(boutOnClick=="Importer")
window.showModalDialog("importer.html",null,"dialogWidth:430px;dialogHeight:280px;center:1;scroll:0;help:0;status:0");
return false;
}
</script>
<%
String vide="....", monIp="", monHote="";
ArrayList List_NomIp = new ArrayList();
NomIp ele1 = new NomIp("serv03", "123");
NomIp ele2 = new NomIp("serv04", "456");
NomIp ele3 = new NomIp("serv05", "789");
List_NomIp.add(0, ele1);
List_NomIp.add(1, ele2);
List_NomIp.add(2, ele3);
NomIp tempo;
int i=0;
for (i=0 ; i<List_NomIp.size() ; i++){
tempo = (NomIp)List_NomIp.get(i);
monHote = request.getParameter("host");
if (monHote.equals (tempo.getNom())){
monIp = tempo.getIp();
}
} %>
<% if (request.getParameter("host").equals(vide) || request.getParameter("service").equals(vide)){
out.println("Veuillez remplir correctement les différents champs <br />");
out.println("Vous aller être redirigé directement sinon cliquez sur le lien ci-dessous <br />");
out.println("<a href=\"index.jsp\">Formulaire de connection </a>");%>
<meta http-equiv=Refresh content="5; url=http://localhost:8084/Interface/index.jsp">
<%} else {
out.println("<form method=\"post\" action=\"connection.jsp\" OnSubmit=\"choixURL()\" id=\"formConnection\">");
out.println("<table style=\"text-align:rigth\">");
out.println("<tr><td>Vous avez choisi l'hôte :</td><td>" + request.getParameter("host") + "</td></tr>");
out.println("<tr><td>L'IP de cet hôte est :</td><td>" + monIp + "</td></tr>");
out.println("<tr><td>Le mode de connection est :</td><td>" + request.getParameter("service") + "</td></tr>");
out.println("<tr><td> </td>" +
"<td><input type = \"submit\" value=\"Envoyer\" onclick=\"document.getElementById('cache').value=this.value\";/></td>" +
"<td><input type = \"submit\" value=\"Annuler\" onclick=\"document.getElementById('cache').value=this.value\";/></td>" +
"<td><input type = \"submit\" value=\"Importer\" onclick=\"document.getElementById('cache').value=this.value\";/></td>" +
"<td><input type='hidden' id='cache'/></td></tr>" +
"</td></tr></table>");
out.println("</table>");
}
%>
</form>
</body>
</html> |
Partager