org.brutusin.demo.http.HttpAwareAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rpc-examples Show documentation
Show all versions of rpc-examples Show documentation
Examples of Brutusin-RPC component implementations
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);
}
}