JSP

JSP Projects

JSP Project

Read the request in JSP
Previous Home Next

 

In this page of the tutorials we are going to show you how to read the all request which is done by the user in a single page.

 

 

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<body>

<p><font size="7" color="#0066ff">Request Information:</font></p>

<div align="left">

<table border="0" cellpadding="0" cellspacing="0" width="70%" bgcolor="#EEFFCA">

<tr>

<td width="33%"><b><font color="#0066ff">Request Method:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getMethod()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Request URI:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getRequestURI()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Request Protocol:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getProtocol()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Path Info:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getPathInfo()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Path translated:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getPathTranslated()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Query String:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getQueryString()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Content length:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getContentLength()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Content type:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getContentType()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Server name:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getServerName()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Server port:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getServerPort()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Remote user:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getRemoteUser()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Remote address:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getRemoteAddr()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Remote host:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getRemoteHost()%></font></td>

</tr>

<tr>

<td width="33%"><b><font color="#0066ff">Authorization scheme:</font></b></td>

<td width="67%"><font color="#FF0000"><%=request.getAuthType()%></font></td>

</tr>

</table>

</div>

</body>

</html>

Previous Home Next