Article View: es.comp.lenguajes.java
Article #356Re: Servlets y configuración
From: GRUPOS DE JAVA
Date: Thu, 17 May 2007 21:01
Date: Thu, 17 May 2007 21:01
35 lines
2533 bytes
2533 bytes
private Logger logger = Logger.getLogger(Nombre_De_Clase.class);
public void service(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException, IllegalStateException
{
try {
this.request = request;
this.response = response;
validarEntrada();
}
public void validarEntrada() throws IOException {
/* Este logger guarda la informacion del cliente que
llega y lo
manda a un archivo de salida con formato html para el
historial
de las conexiones/peticiones que se realiza hacia el
servidor,
este contiene los datos de conexion del usuario */
logger.info("usuario: "+request.getParameter("login")
+","+
"protocolo de peticion:"
+request.getProtocol()+","+
"esquema de peticion: "+request.getScheme()
+","+
"metodo de peticion: "+request.getMethod()
+","+
"Host remoto: "+request.getRemoteHost()
+","+
"direccion remota: "+request.getRemoteAddr()
+","+
"Puerto remoto: "+request.getRemotePort()
+".");
}
espero que te sirva algo el codigo, suerte ;).
Technical Details
Message-ID:
<1179435680.621507.64840@q75g2000hsh.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!q75g2000hsh.googlegroups.com!not-for-mailReferences:
<1179397795.275712.283400@e65g2000hsc.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1116f3,ed80b2b2d8de01a0 X-Google-Attributes: gid1116f3,public X-Google-Language: SPANISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!q75g2000hsh.googlegroups.com!not-for-mail From: GRUPOS DE JAVA <omm1979@gmail.com> Newsgroups: es.comp.lenguajes.java Subject: Re: Servlets y configuración Date: 17 May 2007 14:01:20 -0700 Organization: http://groups.google.com Lines: 36 Message-ID: <1179435680.621507.64840@q75g2000hsh.googlegroups.com> References: <1179397795.275712.283400@e65g2000hsc.googlegroups.com> NNTP-Posting-Host: 189.131.71.75 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1179435680 13231 127.0.0.1 (17 May 2007 21:01:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 17 May 2007 21:01:20 +0000 (UTC) In-Reply-To: <1179397795.275712.283400@e65g2000hsc.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: q75g2000hsh.googlegroups.com; posting-host=189.131.71.75; posting-account=SUVqDAwAAACMYIJlcEhY29h6VjIQnh1_