Package net.jsunit.interceptor

Source Code of net.jsunit.interceptor.RequestSourceInterceptor

package net.jsunit.interceptor;

import com.opensymphony.xwork.Action;
import net.jsunit.action.RequestSourceAware;

import javax.servlet.http.HttpServletRequest;

public class RequestSourceInterceptor extends JsUnitInterceptor {
    public static final String REFERER_HEADER = "Referer";

    protected void execute(Action targetAction) throws Exception {
        RequestSourceAware aware = ((RequestSourceAware) targetAction);
        HttpServletRequest request = request();
        aware.setRequestIPAddress(request.getRemoteAddr());
        aware.setRequestHost(request.getRemoteHost());
        aware.setReferrer(request.getHeader(REFERER_HEADER));
    }

}
TOP

Related Classes of net.jsunit.interceptor.RequestSourceInterceptor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.