Hint: Use the request implicit object to retrieve the values.
Solution:
The file used to run the application is IPAdd.jsp. The file is to be saved in C:\Tomcat 5.Webapps\basic directory.
<html>
<head>
<title>System Information</title>
</head>
<body>
<h3>Details of Remote Computer:</h3>
<b>Computer Name:</b>:
<br>
<%=request.getRemoteHost()%>
<br>
<br>
<b>IP Address:</b>:
<br>
<%=request.getRemoteAddr()%>
<br>
</body>
</html>
The output of the program is as shown in Figure 4.4.
0 nhận xét:
Post a Comment