struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quentin MacDougall <quen...@cs.dal.ca>
Subject Using javax.servlet.Filter to remove proxy's port
Date Thu, 20 May 2004 20:05:10 GMT
I have a webapp which uses Struts and runs fine on Jetty (port 8080).
Im trying to use IISRelayJ so that I can have IIS running on port 80 and
have the requsts redirected to Jetty, and keep port 8080 blocked.

I tried creating a Filter to do this, but it doesnt seem to work.

When I goto http://myhost/myapp it is still redirecting me to
http://myhost:8080/myapp.

Anyone have any clues?  My Filter looks like this:

public final class ProxyFilter implements Filter
{

    public void
    init(FilterConfig filterConfig) throws ServletException
    {
        // empty
    }

    public void
    destroy()
    {
        // empty
    }

    public void
    doFilter(ServletRequest request, ServletResponse response, FilterChain
chain)
        throws IOException, ServletException
    {
        ProxyRequestWrapper wrapper = new
ProxyRequestWrapper((HttpServletRequest)request);

        chain.doFilter(wrapper, response);
    }

    public class ProxyRequestWrapper extends HttpServletRequestWrapper
    {
        public ProxyRequestWrapper(HttpServletRequest request)
        {
            super(request);
        }

        public String getServerName()
        {
            // hard coded for now, will change later
            return "myhostname";
        }

        public int getServerPort()
        {
            // hard coded for now, will change later
            return 80;
        }
    }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message