Jsp
Чтение окружения
try
{
	Enumeration e = request.getHeaderNames();
	while ( e.hasMoreElements() )
	{
		String sServerVariable = (String)e.nextElement();
		out.println( sServerVariable + " = " + request.getHeader( sServerVariable ) + "
"); } out.println( request.getHeader( "referer" ) + "
"); } catch( Exception e ) { throw new ShopException( "Can't do." ); }
Результат для IE:
Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
Accept-Encoding = gzip, deflate
Accept-Language = en-us
Connection = Keep-Alive
Host = www.24x7.customers
User-Agent = Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Результат для NN:
Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Charset = iso-8859-1,*,utf-8
Accept-Encoding = gzip
Accept-Language = en
Connection = Keep-Alive
Cookie = UserId=-1; JSESSIONID=aaaM6IuyR14PGp4rVa
Host = www.24x7.customers
User-Agent = Mozilla/4.08 [en] (WinNT; U ;Nav)
Проставляем HTTP-заголовок Last-Modified, т.к. Апач этого сделать не может. А это нужно для Yandex
java.util.Date dateForLastModified = new java.util.Date ();
response.setDateHeader ( "Last-Modified", dateForLastModified.getTime () );
response.setDateHeader( "Expires", 0 );
response.setHeader("Cache-Control", "private");
//response.setHeader("Cache-Control", "x-anonymous");
Hosted by uCoz