Saturday, 23 April 2016

How to get information about the Web server ?


There are 4 functions that can be used to get more information about the server in which the servlet is running.

In the ServletRequest class :
public String getServerName()
gets the name of the server in which the servlet is running

public int getServerPort()
gets the port number of the server in which the servlet is running

In the ServletContext class : 
public String getServerInfo()
gets the server name and version

public Object getAttribute()
gets a server-dependent attribute

No comments:

Post a Comment

Note: only a member of this blog may post a comment.