You are on page 1of 2

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>JSP Page</title>

</head>

<body>

<p>Date: <c:out value="${ infoDate }" /></p>

<p>

<%

java.util.Date d= new java.util.Date();

String infoDate=d.toString();

out.println( infoDate);

%>

</p>

${ im }

</br>

<img src="img0.jfif"/>

<img width='250' height='150' src= ${ im }/>

</br>

<c:out value="Description technique : " />

<ul>

<li> Méthode d'envoi : <c:out value="${ infoMethod }" /></li>

<li> Ressource :<c:out value="${ infoRequestURL }" /></li>

<li> Protocole :<c:out value="${ infoProtocol }" /></li>

<li> Nom du Serveur : <c:out value="${ infoServerName }" /></li>

<li> Port du Serveur : <c:out value="${ infoServerPort }" /></li>

</ul>

</body>
</html>

//////////////////////////////////////////////////////////////////////////////////////////

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

java.util.Date d= new java.util.Date();

String infoDate=d.toString();

request.setAttribute("infoDate", infoDate);

String infoMethod=request.getMethod();

request.setAttribute("infoMethod", infoMethod);

StringBuffer infoRequestURL=request.getRequestURL();

request.setAttribute("infoRequestURL", infoRequestURL);

String infoProtocol=request.getProtocol();

request.setAttribute("infoProtocol", infoProtocol);

String infoServerName=request.getServerName();

request.setAttribute("infoServerName", infoServerName);

int infoServerPort=request.getServerPort();

request.setAttribute("infoServerPort", infoServerPort);

int nb= (int)(Math.random()*10);

//String im= "img"+ nb +".jfif";

String im="img0.jfif";

request.setAttribute("im", im);

response.setHeader("refresh", "10");

this.getServletContext().getRequestDispatcher( "/WEB-INF/acc.jsp" ).forward( request, response );

You might also like