Package net.jsunit.action

Examples of net.jsunit.action.RequestSourceAware


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));
    }
View Full Code Here


    public void init() {
    }

    public String intercept(ActionInvocation invocation) throws Exception {
        RequestSourceAware aware = (RequestSourceAware) invocation.getAction();
        String ipAddress = aware.getRequestIpAddress();
        if (ipAddress==null || ipAddress.equals("127.0.0.1"))
            return invocation.invoke();
        else
            return DENIED_NOT_LOCALHOST;
    }
View Full Code Here

TOP

Related Classes of net.jsunit.action.RequestSourceAware

Copyright © 2018 www.massapicom. 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.