A JSP/servlet can dynamically create a URL using public methods on the HttpRequest object to get the server’s port, protocol and host. When configured with a redirector, the sever’s port, protocol, and host differ from the redirector. As a JSP/servlet developer, you may decide to redirect JSPs/servlets to the redirector’s host/port instead of the server’s. To facilitate this in EAServer 5.x, the com.sybase.jaguar.webapplicaiton.getServerInfoFrom was used. The EAServer 6.0 equivalent is the application server property httpGetServerInfoFrom. This property has one of three values: “server”, “proxy”, or “source”. Table 4-3 describes the various javax.servlet.http.HttpRequest methods.
HttpRequest method |
Server |
Proxy |
Source |
---|---|---|---|
getServerName() |
Gets the name of the server being redirected to |
Gets the name of the server using the httpDomain property |
Gets the name of the server as typed into the browser |
getServerPort() |
Gets the port of the server being redirected to |
Gets the proxy port from httpsProxyPort or httpsProxyPort |
Gets the port of the server as typed into the browser |
getProtocol() |
Gets the protocol that was used to connect to the server |
Gets the protocol from httpProxyProtocol |
Gets the protocol as typed into the browser |
The EAServer 6.0 default value is “proxy”. If the appropriate setting is not set (httpDomain, httpProxyPort, httpsProxyPort, httpProxyProtocol), then a value of “source” is used.
See Chapter 3, “Creating and Configuring Servers,” in the EAServer System Administration Guide for information about setting “Get Server Info From.”