Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Tarea 2
Tarea 2
www.wikipedia.org
Response.Cookies("Usuario")("nombre")="Felipe"
¿Cómo se consigue recuperar y tratar las cookies
previamente almacenadas?
En cada visita que el cliente haga a la página web, el
servidor de la página se encargará de leer el contenido de la
cookie. Este código es el que se encarga de recuperar el valor
de la cookie:
www.asptutor.com
<html>
<head>
<title>Variables de entorno Tomcat</title>
<link href="css/labreport.css" media="screen"
rel="stylesheet" type="text/css">
</head>
<body>
<h1>Variables de entorno Tomcat</h1>
<table>
<tr>
<th>AUTH_TYPE:</th>
<% String var = request.getAuthType(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>CONTENT_LENGTH:</th>
<% var = String.valueOf(request.getContentLength()); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>CONTENT_TYPE:</th>
<% var = request.getContentType(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>DOCUMENT_ROOT:</th>
<% var = getServletContext().getRealPath("/"); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>PATH_INFO:</th>
<% var = request.getPathInfo(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>PATH_TRANSLATED:</th>
<% var = request.getPathTranslated(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>QUERY_STRING:</th>
<% var = request.getQueryString();%>
<th><%=var %><br /></th>
</tr>
<tr>
<th>REMOTE_ADDR:</th>
<% var = request.getRemoteAddr(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>REMOTE_HOST:</th>
<% var = request.getRemoteHost(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>REMOTE_USER:</th>
<% var = request.getRemoteUser(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>REQUEST_METHOD:</th>
<% var = request.getMethod(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>SCRIPT_NAME:</th>
<% var = request.getServletPath(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>SERVER_NAME:</th>
<% var = request.getServerName(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>SERVER_PORT:</th>
<% var = String.valueOf(request.getServerPort()); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>SERVER_PROTOCOL:</th>
<% var = request.getProtocol(); %>
<th><%=var %><br /></th>
</tr>
<tr>
<th>SERVER_SOFTWARE:</th>
<% var = getServletContext().getServerInfo(); %>
<th><%=var %><br /></th>
</tr>
</table>
</body>
</html>
Tareas sobre ASP
• Request
Colección.FORM
Colección.QueryString
Colección.ServerVariables
Colección.Params
System.Collections.Specialized.NameValueCollection myCol =
Request.Params;
string userName = Request.Params.Get("txtUserName");
Server.Transfer("SecondPage.aspx");
Y la segunda página se encargará de recibir los valores de
la siguiente forma:
• Response
Propiedad Buffer:
Si esta propiedad está a true (opción por defecto en ASP
3.0) indica al servidor que debe utilizar el buffer
intermedio. Si está a false no lo utiliza. Por defecto esta a
false, es decir, se vuel c a e l c o n t e n i d o d i r e c t a m e n t e e n
pantalla.
Propiedad ContentType:
Especifica el tipo de contenido Http para la respuesta. Si
no se especifica ningún ContentType, el utilizado por defecto
es texto/HTML. Por ejemplo un par de valores que puede
adquirir son:
<% Response.ContentType = "text/HTML" %>
<% Response.ContentType = "image/GIF" %>
Método End:
Hace que el script ASP termine, y como consecuencia
propicia que el buffer intermedio se vuelque sobre la pantalla.
Método Redirect:
Hace que el navegador redireccione al cliente a una URL
diferente.
Método Write:
Es el método utilizado para devolver cualquier tipo de
texto en una página web. Es decir podemos encontrar texto
plano, etiquetas HTML, código Script...
• Session
• Application
http://www.aspfacil.com
http://www.aulambra.com/ver2.asp?id=174&tipo=#contents
• Global.asax
http://msdn.microsoft.com/