You are here: Re: JSP equivalent to PHP $_SERVER? « PHP Programming Language « IT news, forums, messages
Re: JSP equivalent to PHP $_SERVER?

Posted by James Westby on 09/28/62 11:37

comp.lang.php wrote:
> I looked up System.getProperties, but to be honest, I have no clue how
> to use it in light of what I can do in PHP, which is this:
>
> <?php echo $_SERVER['HTTP_USER_AGENT'] . ' ' . $_SERVER['SERVER_URI'];
> ?>
>
> it would be very nice to find the JSP equivalent of <? phpinfo(); ?>
> (anyone know who knows both PHP and JSP?) but until then, what on earth
> do I do?
>
> Thanx
> Phil
>


User agent is a Http header right?

If so you want

String getHeader(String) on the HttpServletRequest

e.g.

request.getHeader("User-Agent");

this returns a String that you can do what you like with.

I don't know php, but looking up phpinfo() it seems like there wont be a
single Java equivalent, as no object has all that information at its
disposal. Some of the information is probably availabel through
different methods though.

James

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация