src/main/java/com/gravitext/testservlets/SnoopServlet.java in jetty-6.1.18.1 vs src/main/java/com/gravitext/testservlets/SnoopServlet.java in jetty-6.1.19.1
- old
+ new
@@ -28,11 +28,11 @@
public class SnoopServlet extends HttpServlet
{
@Override
- protected void doGet( HttpServletRequest request,
+ protected void doGet( HttpServletRequest request,
HttpServletResponse response )
throws ServletException, IOException
{
response.setContentType("text/html; charset=UTF-8" );
@@ -54,44 +54,44 @@
writeRow( out, "Servlet Path", request.getServletPath() );
writeRow( out, "Is Secure", String.valueOf( request.isSecure() ) );
writeRow( out, "Auth Type", request.getAuthType() );
writeRow( out, "Remote User", request.getRemoteUser() );
out.println( "</table>" );
-
+
writeTableHeader( out, "Request Headers", "Header" );
Enumeration<?> hNames = request.getHeaderNames();
while( hNames.hasMoreElements() ) {
String hname = hNames.nextElement().toString();
String hvalue = request.getHeader( hname );
writeRow( out, hname, hvalue );
}
out.println( "</table>" );
-
+
Cookie[] cookies = request.getCookies();
if (cookies != null) {
writeTableHeader( out, "Cookies", "Cookie" );
for( Cookie cookie : cookies ) {
writeRow( out, cookie.getName(), cookie.getValue() );
}
out.println( "</table>" );
}
-
+
out.println( "</body>" );
out.println( "</html>" );
out.close();
}
- private void writeTableHeader( PrintWriter out,
+ private void writeTableHeader( PrintWriter out,
String heading, String name )
{
out.println( "<h2>" + heading + "</h2>" );
out.println( "<table><tr><th>" + name + "</th><th>Value</th></tr>" );
}
private void writeRow( PrintWriter out, String name, String value )
{
- out.println( String.format( "<tr><td>%s</td><td>%s</td></tr>",
+ out.println( String.format( "<tr><td>%s</td><td>%s</td></tr>",
name, value ) );
}
-
+
private static final long serialVersionUID = 1L;
}