All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fastchar.out.FastOutForward Maven / Gradle / Ivy

package com.fastchar.out;

import com.fastchar.core.FastAction;
import com.fastchar.core.FastChar;
import com.fastchar.core.FastDispatcher;
import com.fastchar.core.FastRequestLog;

/**
 * 转发请求
 */
public class FastOutForward extends FastOut {


    @Override
    public void response(FastAction action) throws Exception {
        this.setDescription("forward to url '" + data + "'");
        String url = String.valueOf(data);
        if (url.split("\\?")[0].lastIndexOf(".") > 0) {
            action.getRequest().getRequestDispatcher(url)
                    .forward(action.getRequest(), action.getResponse());
            FastRequestLog.log(action);
            return;
        }
        new FastDispatcher(action.getRequest(), action.getResponse())
                .setContentUrl(url)
                .setForwarder(action)
                .invoke();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy