Example usage for javax.servlet.http HttpServletRequestWrapper getServerPort

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

Introduction

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

Prototype

public int getServerPort() 

Source Link

Document

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

Usage

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

/**
 * /*from  w ww  .java2 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;
}