Java/JSP/Log
Версия от 18:01, 31 мая 2010; (обсуждение)
Using Log Files
<HTML>
<HEAD>
<TITLE>Using Log Files</TITLE>
</HEAD>
<BODY>
<H1>Using Log Files</H1>
This page writes to a log file.
<%
String address = request.getRemoteAddr();
String file = ((HttpServletRequest) request).getRequestURI();
session.getServletContext().log(
"User access! " +
" User IP: " + address +
" Resource: " + file
);
%>
</BODY>
</HTML>