Example usage for javax.servlet.http HttpServletRequestWrapper getServerName

List of usage examples for javax.servlet.http HttpServletRequestWrapper getServerName

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletRequestWrapper getServerName.

Prototype

public String getServerName() 

Source Link

Document

The default behavior of this method is to return getServerName() on the wrapped request object.

Usage

From source file:com.idega.block.rss.business.RSSAbstractProducer.java

/**
 * // www . j a  v a2 s.c  o m
 * @param URI
 * @param rssRequest
 * @return the full URL with the http protocol, servername and port with the URI suffixed
 */
public String getServerURLWithURI(String URI, RSSRequest rssRequest) {
    HttpServletRequestWrapper wrapped = rssRequest.getRequestWrapped();

    return "http://" + wrapped.getServerName() + ":" + wrapped.getServerPort() + URI;
}