1 17 package org.apache.geronimo.tomcat.valve; 18 19 import org.apache.catalina.valves.ValveBase; 20 import org.apache.catalina.connector.Request; 21 import org.apache.catalina.connector.Response; 22 23 import javax.servlet.ServletException ; 24 import javax.security.jacc.PolicyContext ; 25 import java.io.IOException ; 26 27 30 31 public class PolicyContextValve extends ValveBase{ 32 33 private final String policyContextID; 34 35 public PolicyContextValve(String policyContextID){ 36 this.policyContextID = policyContextID; 37 } 38 39 public void invoke(Request request, Response response) throws IOException , ServletException { 40 41 String oldId = PolicyContext.getContextID(); 42 43 PolicyContext.setContextID(policyContextID); 44 PolicyContext.setHandlerData(request); 45 46 getNext().invoke(request, response); 48 49 PolicyContext.setContextID(oldId); 50 } 51 } 52 | Popular Tags |