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

org.brutusin.demo.http.HttpAwareAction Maven / Gradle / Ivy

There is a newer version: 1.9.2
Show newest version
package org.brutusin.demo.http;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.brutusin.rpc.http.Cacheable;
import org.brutusin.rpc.http.HttpActionSupport;
import org.brutusin.rpc.http.SafeAction;

public class HttpAwareAction extends SafeAction> {

    @Override
    public Cacheable> execute(Void input) throws Exception {
        HttpServletRequest httpReq = HttpActionSupport.getInstance().getHttpServletRequest();
        List ret = new ArrayList();
        Enumeration headerNames = httpReq.getHeaderNames();
        while (headerNames.hasMoreElements()) {
            String header = headerNames.nextElement();
            ret.add(header + ":" + httpReq.getHeader(header));
        }
        return Cacheable.never(ret);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy