Java Code Examples for javax.servlet.ServletException

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project Blitz, under directory /src/com/laxser/blitz/.

Source file: BlitzFilter.java

  18 
vote

/** 
 * ???????????????????
 * @param requestPath
 * @param exception
 * @throws ServletException
 */
private void throwServletException(RequestPath requestPath,Throwable exception) throws ServletException {
  String msg=requestPath.getMethod() + " " + requestPath.getUri();
  ServletException servletException;
  if (exception instanceof ServletException) {
    servletException=(ServletException)exception;
  }
 else {
    servletException=new NestedServletException(msg,exception);
  }
  logger.error(msg,exception);
  getServletContext().log(msg,exception);
  throw servletException;
}
 

Example 2

From project aerogear-controller, under directory /src/main/java/org/jboss/aerogear/controller/router/.

Source file: DefaultRouter.java

  17 
vote

private void invokeErrorRoute(final Route errorRoute,final Throwable t) throws ServletException {
  try {
    final Method targetMethod=errorRoute.getTargetMethod();
    if (targetMethod.getParameterTypes().length == 0) {
      targetMethod.invoke(getController(errorRoute));
    }
 else {
      targetMethod.invoke(getController(errorRoute),t);
    }
  }
 catch (  final Exception e) {
    throw new ServletException(e.getMessage(),e);
  }
}
 

Example 3

From project agileBase, under directory /gtpb_server/src/com/gtwm/pb/servlets/.

Source file: CalendarPublisher.java

  17 
vote

public void init() throws ServletException {
  ServletContext servletContext=getServletContext();
  this.databaseDefn=(DatabaseInfo)servletContext.getAttribute("com.gtwm.pb.servlets.databaseDefn");
  if (this.databaseDefn == null) {
    throw new ServletException("Error starting CalendarPublisher servlet. No databaseDefn object in the servlet context");
  }
}
 

Example 4

From project ANNIS, under directory /annis-gui/src/main/java/annis/gui/servlets/.

Source file: BinaryServlet.java

  17 
vote

@Override public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException {
  Map<String,String[]> binaryParameter=request.getParameterMap();
  toplevelCorpusName=binaryParameter.get("toplevelCorpusName")[0];
  documentName=binaryParameter.get("documentName")[0];
  ServletOutputStream out=null;
  try {
    out=response.getOutputStream();
    String range=request.getHeader("Range");
    String annisServiceURL=getServletContext().getInitParameter("AnnisWebService.URL");
    if (annisServiceURL == null) {
      throw new ServletException("AnnisWebService.URL was not set as init parameter in web.xml");
    }
    WebResource annisRes=client.resource(annisServiceURL);
    WebResource binaryRes=annisRes.path("corpora").path(URLEncoder.encode(toplevelCorpusName,"UTF-8")).path(URLEncoder.encode(documentName,"UTF-8")).path("binary");
    if (range != null) {
      responseStatus206(binaryRes,out,response,range);
    }
 else {
      responseStatus200(binaryRes,out,response);
    }
    out.flush();
  }
 catch (  IOException ex) {
    log.debug("IOException in BinaryServlet",ex);
  }
catch (  ClientHandlerException ex) {
    log.error(null,ex);
    response.setStatus(500);
  }
catch (  UniformInterfaceException ex) {
    log.error(null,ex);
    response.setStatus(500);
  }
}
 

Example 5

From project atlassian-rest-cli, under directory /rest-cli-runner/src/main/java/com/galeoconsulting/leonardinius/servlet/.

Source file: ScriptRunnerSessionServlet.java

  17 
vote

private void doExecuteHttpMethod(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  try {
    webSudoManager.willExecuteWebSudoRequest(request);
    if (loginIfNot(request,response))     return;
    if (!IsSystemAdminRequest(request)) {
      throw new ServletException("The action could only be executed by system administrators");
    }
    response.setContentType(MediaType.TEXT_HTML);
    templateRenderer.render(checkNotNull(getVelocityTemplate(request),"templateName"),makeContext(),response.getWriter());
  }
 catch (  WebSudoSessionException wes) {
    webSudoManager.enforceWebSudoProtection(request,response);
  }
}
 

Example 6

From project avro, under directory /lang/java/ipc/src/main/java/org/apache/avro/ipc/.

Source file: ResponderServlet.java

  17 
vote

@Override protected void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException {
  response.setContentType(HttpTransceiver.CONTENT_TYPE);
  List<ByteBuffer> requestBufs=HttpTransceiver.readBuffers(request.getInputStream());
  try {
    List<ByteBuffer> responseBufs=responder.respond(requestBufs);
    response.setContentLength(HttpTransceiver.getLength(responseBufs));
    HttpTransceiver.writeBuffers(responseBufs,response.getOutputStream());
  }
 catch (  AvroRuntimeException e) {
    throw new ServletException(e);
  }
}
 

Example 7

From project azkaban, under directory /azkaban/src/java/azkaban/web/.

Source file: JobManagerServlet.java

  17 
vote

private File extractFile(FileItem item) throws IOException, ServletException {
  final String contentType=item.getContentType();
  if (contentType.startsWith("application/zip")) {
    return unzipFile(item);
  }
  if (contentType.startsWith("application/x-tar")) {
    return untarFile(item);
  }
  throw new ServletException(String.format("Unsupported file type[%s].",contentType));
}
 

Example 8

From project brix-cms-plugins, under directory /examples/example-file-article-gallery/src/main/java/brix/demo/gallery/webdav/.

Source file: GalleryServlet.java

  17 
vote

@Override public synchronized SessionProvider getSessionProvider(){
  final SessionProvider original=super.getSessionProvider();
  return new SessionProvider(){
    public Session getSession(    HttpServletRequest request,    Repository rep,    String workspace) throws LoginException, ServletException, RepositoryException {
      final String key=Brix.NS_PREFIX + "jcr-session";
      BrixSession s=(BrixSession)request.getAttribute(key);
      if (s == null) {
        s=EventUtil.wrapSession(original.getSession(request,rep,workspace));
        for (        Plugin p : getBrix().getPlugins()) {
          if (p instanceof SessionAwarePlugin) {
            ((SessionAwarePlugin)p).onWebDavSession(s);
          }
        }
        request.setAttribute(key,s);
      }
      return s;
    }
    public void releaseSession(    Session session){
      original.releaseSession(EventUtil.unwrapSession(session));
    }
  }
;
}
 

Example 9

From project candlepin, under directory /src/test/java/org/candlepin/servlet/filter/.

Source file: CandlepinScopeFilterTest.java

  17 
vote

@Test public void ensureFilterExitsScopeOnError() throws Exception {
  doThrow(new ServletException()).when(chain).doFilter(request,response);
  try {
    filter.doFilter(request,response,chain);
    fail("Expected an exception to be thrown.");
  }
 catch (  ServletException e) {
  }
  verify(scope).enter();
  verify(scope).exit();
}
 

Example 10

From project capedwarf-blue, under directory /admin/src/main/java/org/jboss/capedwarf/admin/.

Source file: AdminServlet.java

  17 
vote

private void createVelocityEngine() throws ServletException {
  try {
    Properties props=new Properties();
    props.put("resource.loader","class");
    props.put("class.resource.loader.class",ClasspathResourceLoader.class.getName());
    velocity=new VelocityEngine(props);
  }
 catch (  Exception e) {
    throw new ServletException(e);
  }
}
 

Example 11

From project capedwarf-green, under directory /server-api/src/main/java/org/jboss/capedwarf/server/api/mvc/.

Source file: MultiRequestHandler.java

  17 
vote

/** 
 * Find matching request handler.
 * @param req the request
 * @return matching request handler
 * @throws ServletException if handler is not found
 */
protected RequestHandler findHandler(HttpServletRequest req) throws ServletException {
  for (  HandlerMapping hm : mappings) {
    RequestHandler handler=hm.findHandler(req);
    if (handler != null)     return handler;
  }
  throw new ServletException("No such mapping: " + req.getRequestURL() + " - "+ mappings);
}
 

Example 12

From project agile, under directory /agile-framework/src/main/java/org/apache/catalina/servlets/.

Source file: WebdavServlet.java

  16 
vote

/** 
 * Return JAXP document builder instance.
 */
protected DocumentBuilder getDocumentBuilder() throws ServletException {
  DocumentBuilder documentBuilder=null;
  DocumentBuilderFactory documentBuilderFactory=null;
  try {
    documentBuilderFactory=DocumentBuilderFactory.newInstance();
    documentBuilderFactory.setNamespaceAware(true);
    documentBuilderFactory.setExpandEntityReferences(false);
    documentBuilder=documentBuilderFactory.newDocumentBuilder();
    documentBuilder.setEntityResolver(new WebdavResolver(this.getServletContext()));
  }
 catch (  ParserConfigurationException e) {
    throw new ServletException("JAXP initialization failed");
  }
  return documentBuilder;
}
 

Example 13

From project agraph-java-client, under directory /src/test/web/.

Source file: AGTestServlet.java

  16 
vote

@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  Closer c=new Closer();
  try {
    Context initCtx=c.closeLater(new InitialContext());
    Context envCtx=(Context)c.closeLater(initCtx.lookup("java:comp/env"));
    AGConnPool pool=(AGConnPool)envCtx.lookup("connection-pool/agraph");
    AGRepositoryConnection conn=c.closeLater(pool.borrowConnection());
    resp.getWriter().println("size=" + conn.size());
    resp.getWriter().flush();
  }
 catch (  Exception e) {
    throw new ServletException(e);
  }
 finally {
    c.close();
  }
}
 

Example 14

From project aio-webos, under directory /webui/webos/src/main/java/org/exoplatform/webos/common/filter/.

Source file: LazyDesktopPageCreation.java

  16 
vote

public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest httpRequest=(HttpServletRequest)request;
  String userName=httpRequest.getRemoteUser();
  try {
    ExoContainer container=ExoContainerContext.getCurrentContainer();
    RequestLifeCycle.begin(container);
    if (userName != null) {
      try {
        Class.forName(UIDesktopPage.class.getName());
      }
 catch (      ClassNotFoundException e) {
        throw new ServletException(e);
      }
      createPortalConfig(container,userName);
      createUserPage(container,userName);
    }
  }
 catch (  Throwable t) {
    log.debug("Could not create User Portal Config or User Desktop Page for " + userName,t);
  }
 finally {
    chain.doFilter(httpRequest,response);
    RequestLifeCycle.end();
  }
}
 

Example 15

From project alfredo, under directory /alfredo/src/main/java/com/cloudera/alfredo/server/.

Source file: KerberosAuthenticationHandler.java

  16 
vote

/** 
 * Initializes the authentication handler instance. <p/> It creates a Kerberos context using the principal and keytab specified in the configuration. <p/> This method is invoked by the  {@link AuthenticationFilter#init} method.
 * @param config configuration properties to initialize the handler.
 * @throws ServletException thrown if the handler could not be initialized.
 */
@Override public void init(Properties config) throws ServletException {
  try {
    principal=config.getProperty(PRINCIPAL,principal);
    if (principal == null || principal.trim().length() == 0) {
      throw new ServletException("Principal not defined in configuration");
    }
    keytab=config.getProperty(KEYTAB,keytab);
    if (keytab == null || keytab.trim().length() == 0) {
      throw new ServletException("Keytab not defined in configuration");
    }
    if (!new File(keytab).exists()) {
      throw new ServletException("Keytab does not exist: " + keytab);
    }
    Set<Principal> principals=new HashSet<Principal>();
    principals.add(new KerberosPrincipal(principal));
    Subject subject=new Subject(false,principals,new HashSet<Object>(),new HashSet<Object>());
    KerberosConfiguration kerberosConfiguration=new KerberosConfiguration(keytab,principal);
    loginContext=new LoginContext("",subject,null,kerberosConfiguration);
    loginContext.login();
    Subject serverSubject=loginContext.getSubject();
    try {
      gssManager=Subject.doAs(serverSubject,new PrivilegedExceptionAction<GSSManager>(){
        @Override public GSSManager run() throws Exception {
          return GSSManager.getInstance();
        }
      }
);
    }
 catch (    PrivilegedActionException ex) {
      throw ex.getException();
    }
    LOG.info("Initialized, principal [{}] from keytab [{}]",principal,keytab);
  }
 catch (  Exception ex) {
    throw new ServletException(ex);
  }
}
 

Example 16

From project amber, under directory /oauth-2.0/resourceserver-filter/src/main/java/org/apache/amber/oauth2/rsfilter/.

Source file: OAuthUtils.java

  16 
vote

public static Object loadObject(ServletContext context,String classParamName,Class expectedClass) throws ServletException {
  Object ob=null;
  String providerClassName=context.getInitParameter(classParamName);
  if (isEmpty(providerClassName)) {
    throw new ServletException(classParamName + " context param required");
  }
  try {
    Class<?> clazz=Class.forName(providerClassName);
    if (!expectedClass.isAssignableFrom(clazz)) {
      throw new ServletException(classParamName + " class: " + providerClassName+ " must be an instance of: "+ expectedClass.getName());
    }
    ob=createObjectFromClassName(clazz);
  }
 catch (  ClassNotFoundException e) {
    throw new ServletException(classParamName + " class " + providerClassName+ " not found");
  }
catch (  Exception e) {
    throw new ServletException("Cannot instantiate: " + providerClassName);
  }
  return ob;
}
 

Example 17

From project apjp, under directory /APJP_REMOTE_JAVA/src/main/java/APJP/HTTP/.

Source file: HTTPServlet.java

  16 
vote

public void init(ServletConfig servletConfig) throws ServletException {
  super.init(servletConfig);
  logger=Logger.getLogger(HTTPServlet.class.getName());
  Properties properties=new Properties();
  try {
    properties.load(getServletContext().getResourceAsStream("/WEB-INF/APJP_REMOTE.properties"));
  }
 catch (  Exception e) {
    throw new ServletException(e);
  }
  APJP_KEY=properties.getProperty("APJP_KEY","");
  APJP_REMOTE_HTTP_SERVER_RESPONSE_PROPERTY_KEY=new String[5];
  APJP_REMOTE_HTTP_SERVER_RESPONSE_PROPERTY_VALUE=new String[5];
  for (int i=0; i < APJP_REMOTE_HTTP_SERVER_RESPONSE_PROPERTY_KEY.length; i=i + 1) {
    APJP_REMOTE_HTTP_SERVER_RESPONSE_PROPERTY_KEY[i]=properties.getProperty("APJP_REMOTE_HTTP_SERVER_RESPONSE_PROPERTY_" + (i + 1) + "_KEY","");
    APJP_REMOTE_HTTP_SERVER_RESPONSE_PROPERTY_VALUE[i]=properties.getProperty("APJP_REMOTE_HTTP_SERVER_RESPONSE_PROPERTY_" + (i + 1) + "_VALUE","");
  }
}
 

Example 18

From project appdriver, under directory /android/src/com/google/android/testing/nativedriver/server/.

Source file: AndroidNativeDriverServlet.java

  16 
vote

/** 
 * Registers the AND WebDriver implementation with the Jetty server so AND will start when the corresponding Capabilities are requested. Then it calls the base class' implementation.
 */
@Override public void init() throws ServletException {
  DefaultDriverSessions driverSessions=new DefaultDriverSessions();
  driverSessions.registerDriver(AndroidCapabilities.get(),AndroidNativeDriver.class);
  getServletContext().setAttribute(SESSIONS_KEY,driverSessions);
  super.init();
  try {
    addNewPostMapping(SESSION_PATH + "element",AndroidNativeFindElement.class).on(ResultType.SUCCESS,newJsonResult());
    addNewPostMapping(SESSION_PATH + "elements",AndroidNativeFindElements.class).on(ResultType.SUCCESS,newJsonResult());
    addNewPostMapping(SESSION_PATH + "element/:id/element",AndroidNativeFindChildElement.class).on(ResultType.SUCCESS,newJsonResult());
    addNewPostMapping(SESSION_PATH + "element/:id/elements",AndroidNativeFindChildElements.class).on(ResultType.SUCCESS,newJsonResult());
    addNewPostMapping(SESSION_PATH + "element/:id/value",AndroidNativeSendKeys.class).on(ResultType.SUCCESS,newEmptyResult());
    addNewPostMapping(SESSION_PATH + "click",Click.class).on(ResultType.SUCCESS,newEmptyResult());
    addNewPostMapping(SESSION_PATH + "doubleclick",DoubleTap.class).on(ResultType.SUCCESS,newEmptyResult());
    addNewPostMapping(SESSION_PATH + "buttondown",TouchDown.class).on(ResultType.SUCCESS,newEmptyResult());
    addNewPostMapping(SESSION_PATH + "moveto",TouchMove.class).on(ResultType.SUCCESS,newEmptyResult());
    addNewPostMapping(SESSION_PATH + "buttonup",TouchUp.class).on(ResultType.SUCCESS,newEmptyResult());
  }
 catch (  Exception exception) {
    throw new ServletException(exception);
  }
}
 

Example 19

From project aws-tvm-anonymous, under directory /src/com/amazonaws/tvm/.

Source file: RootServlet.java

  16 
vote

public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException {
  try {
    String forwardTo=null;
    try {
      forwardTo=this.processRequest(request,response);
    }
 catch (    Exception exception) {
      this.handleException(request,response,exception);
    }
    if (forwardTo != null) {
      RequestDispatcher dispatcher=getServletContext().getRequestDispatcher(forwardTo);
      dispatcher.forward(request,response);
    }
  }
 catch (  Exception exception) {
    throw new ServletException(exception);
  }
}
 

Example 20

From project aws-tvm-identity, under directory /src/com/amazonaws/tvm/.

Source file: RootServlet.java

  16 
vote

public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException {
  try {
    String forwardTo=null;
    try {
      forwardTo=this.processRequest(request,response);
    }
 catch (    Exception exception) {
      this.handleException(request,response,exception);
    }
    if (forwardTo != null) {
      RequestDispatcher dispatcher=getServletContext().getRequestDispatcher(forwardTo);
      dispatcher.forward(request,response);
    }
  }
 catch (  Exception exception) {
    throw new ServletException(exception);
  }
}
 

Example 21

From project CalendarPortlet, under directory /src/main/java/org/jasig/portlet/calendar/mvc/.

Source file: AggregationAwareFilterBean.java

  16 
vote

@Override public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  if (this.elementsProvider.getIncludedType((HttpServletRequest)request) == Included.AGGREGATED) {
    if (logger.isDebugEnabled()) {
      logger.debug("Aggregation enabled, delegating to filter: " + this.filter);
    }
    this.filter.doFilter(request,response,chain);
  }
 else {
    if (logger.isDebugEnabled()) {
      logger.debug("Aggregation disabled, skipping filter: " + this.filter);
    }
    chain.doFilter(request,response);
  }
}
 

Example 22

From project Carolina-Digital-Repository, under directory /djatoka-cdr/src/gov/lanl/adore/djatoka/openurl/.

Source file: OpenURLServlet.java

  16 
vote

public void init(ServletConfig config) throws ServletException {
  super.init(config);
  try {
    openURLConfig=new org.oclc.oomRef.config.OpenURLConfig(config);
    transports=openURLConfig.getTransports();
    processor=openURLConfig.getProcessor();
    ClassLoader cl=OpenURLServlet.class.getClassLoader();
    java.net.URL url=cl.getResource("access.txt");
    if (url != null)     am=new AccessManager(url.getFile());
    url=cl.getResource("authentication.properties");
    logger.debug("Authentication properties path: " + url.toString());
    if (url != null) {
      authManager=new AuthenticationManager(IOUtils.loadProperty(new FileInputStream(url.getFile())));
      IOUtils.authManager=authManager;
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new ServletException(e.getMessage(),e);
  }
}
 

Example 23

From project 3Dto2DApplet, under directory /src/java/nl/dannyarends/gameserver/.

Source file: ServerServlet.java

  15 
vote

@Override public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException {
  res.setContentType("text/html");
  OutputStream o=res.getOutputStream();
  o.write(("<html>\n").getBytes());
  o.write(("\t<head>\n").getBytes());
  o.write(("\t<title>Applets</title>\n").getBytes());
  o.write(("\t</head>\n").getBytes());
  o.write(("\t<body>\n").getBytes());
  o.write(("\tOverview:<br>\n").getBytes());
  for (  CompileUnit applet : server.appletCompiler.getApplets()) {
    String filename=applet.getJarName().substring(applet.getJarName().lastIndexOf("/") + 1);
    o.write(("\t\t<APPLET codebase='data/' code='" + applet.mainClass.replace(".","/") + ".class' archive='"+ filename+ "'></APPLET><br/>\n").getBytes());
  }
  o.write(("\t</body>\n").getBytes());
  o.write(("</html>\n").getBytes());
  o.flush();
  o.close();
}
 

Example 24

From project accesointeligente, under directory /src/org/accesointeligente/server/.

Source file: GWTCacheControlFilter.java

  15 
vote

public void doFilter(ServletRequest request,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest httpRequest=(HttpServletRequest)request;
  String requestURI=httpRequest.getRequestURI();
  if (requestURI.contains(".nocache.")) {
    Date now=new Date();
    HttpServletResponse httpResponse=(HttpServletResponse)response;
    httpResponse.setDateHeader("Date",now.getTime());
    httpResponse.setDateHeader("Expires",now.getTime() - 86400000L);
    httpResponse.setHeader("Pragma","no-cache");
    httpResponse.setHeader("Cache-control","no-cache, no-store, must-revalidate");
  }
  filterChain.doFilter(request,response);
}
 

Example 25

From project AceWiki, under directory /src/ch/uzh/ifi/attempto/acewiki/.

Source file: AceWikiServlet.java

  15 
vote

/** 
 * Init the AceWiki servlet, get its Backend from ServletContext according to its config in web.xml or create backend if no 'backend' parameter exist.
 * @param config servlet config.
 */
public void init(ServletConfig config) throws ServletException {
  parameters=getInitParameters(config);
  if (logger == null) {
    logger=new Logger(parameters.get("context:logdir") + "/syst","syst",0);
  }
  backendName=config.getInitParameter("backend");
  if (backendName != null) {
    logger.log("appl","use backend: " + backendName);
    while (true) {
      backend=(Backend)config.getServletContext().getAttribute(backendName);
      if (backend != null)       break;
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException e) {
        break;
      }
    }
    Map<String,String> p=parameters;
    parameters=new HashMap<String,String>();
    parameters.putAll(backend.getParameters());
    parameters.putAll(p);
  }
 else {
    logger.log("appl","create backend");
    APE.setParameters(parameters);
    backend=new Backend(parameters);
  }
  super.init(config);
}
 

Example 26

From project activiti-explorer, under directory /src/main/java/org/activiti/explorer/servlet/.

Source file: ExplorerApplicationServlet.java

  15 
vote

@Override protected void writeAjaxPageHtmlVaadinScripts(Window window,String themeName,Application application,BufferedWriter page,String appUrl,String themeUri,String appId,HttpServletRequest request) throws ServletException, IOException {
  super.writeAjaxPageHtmlVaadinScripts(window,themeName,application,page,appUrl,themeUri,appId,request);
  String scrollJs=themeUri + "/js/vscrollarea.js";
  page.write("<script type=\"text/javascript\" src=\"" + scrollJs + "\" />");
  String browserDependentCss="<script type=\"text/javascript\">//<![CDATA[" + "var mobi = ['opera', 'iemobile', 'webos', 'android', 'blackberry', 'ipad', 'safari'];" + "var midp = ['blackberry', 'symbian'];"+ "var ua = navigator.userAgent.toLowerCase();"+ "if ((ua.indexOf('midp') != -1) || (ua.indexOf('mobi') != -1) || ((ua.indexOf('ppc') != -1) && (ua.indexOf('mac') == -1)) || (ua.indexOf('webos') != -1)) {"+ "  document.write('<link rel=\"stylesheet\" href=\"" + themeUri + "/allmobile.css\" type=\"text/css\" media=\"all\"/>');"+ "  if (ua.indexOf('midp') != -1) {"+ "    for (var i = 0; i < midp.length; i++) {"+ "      if (ua.indexOf(midp[i]) != -1) {"+ "        document.write('<link rel=\"stylesheet\" href=\""+ themeUri+ "' + midp[i] + '.css\" type=\"text/css\"/>');"+ "      }"+ "    }"+ "  }"+ "   else {"+ "     if ((ua.indexOf('mobi') != -1) || (ua.indexOf('ppc') != -1) || (ua.indexOf('webos') != -1)) {"+ "       for (var i = 0; i < mobi.length; i++) {"+ "         if (ua.indexOf(mobi[i]) != -1) {"+ "           if ((mobi[i].indexOf('blackberry') != -1) && (ua.indexOf('6.0') != -1)) {"+ "             document.write('<link rel=\"stylesheet\" href=\""+ themeUri+ "' + mobi[i] + '6.0.css\" type=\"text/css\"/>');"+ "           }"+ "           else {"+ "             document.write('<link rel=\"stylesheet\" href=\""+ themeUri+ "' + mobi[i] + '.css\" type=\"text/css\"/>');"+ "           }"+ "          break;"+ "         }"+ "       }"+ "     }"+ "   }"+ " }"+ "if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPad') != -1)) {"+ " document.write('<meta name=\"viewport\" content=\"width=device-width\" />');"+ "}"+ "  //]]>"+ "</script>"+ "<!--[if lt IE 7]><link rel=\"stylesheet\" type=\"text/css\" href=\""+ themeUri+ "/lt7.css\" /><![endif]-->";
  page.write(browserDependentCss);
}
 

Example 27

From project AdServing, under directory /modules/server/adserver/src/main/java/net/mad/ads/server/servlet/.

Source file: AdServlet.java

  15 
vote

/** 
 * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  final AsyncContext ctx=request.startAsync();
  ctx.setTimeout(CALLBACK_TIMEOUT);
  ctx.addListener(new AsyncListener(){
    /** 
 * complete() has already been called on the async context, nothing to do 
 */
    public void onComplete(    AsyncEvent event) throws IOException {
    }
    /** 
 * timeout has occured in async task... handle it 
 */
    public void onTimeout(    AsyncEvent event) throws IOException {
      log("onTimeout called");
      log(event.toString());
      ctx.getResponse().getWriter().write("TIMEOUT");
      ctx.complete();
    }
    /** 
 * THIS NEVER GETS CALLED - error has occured in async task... handle it 
 */
    public void onError(    AsyncEvent event) throws IOException {
      log("onError called");
      log(event.toString());
      ctx.getResponse().getWriter().write("ERROR");
      ctx.complete();
    }
    /** 
 * async context has started, nothing to do 
 */
    public void onStartAsync(    AsyncEvent event) throws IOException {
    }
  }
);
  execute(ctx,AdContextListener.ADCONTEXT.get());
}
 

Example 28

From project airlift, under directory /http-client/src/test/java/io/airlift/http/client/.

Source file: EchoServlet.java

  15 
vote

@Override protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  requestMethod=request.getMethod();
  requestUri=URI.create(HttpUtils.getRequestURL(request).toString());
  requestHeaders.clear();
  for (  String name : Collections.list(request.getHeaderNames())) {
    requestHeaders.putAll(name,Collections.list(request.getHeaders(name)));
  }
  if (responseStatusMessage != null) {
    response.sendError(responseStatusCode,responseStatusMessage);
  }
 else {
    response.setStatus(responseStatusCode);
  }
  for (  Map.Entry<String,String> entry : responseHeaders.entries()) {
    response.addHeader(entry.getKey(),entry.getValue());
  }
  try {
    if (request.getParameter("sleep") != null) {
      Thread.sleep(Long.parseLong(request.getParameter("sleep")));
    }
  }
 catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
    return;
  }
  if (request.getParameter("remotePort") != null) {
    response.addHeader("remotePort",String.valueOf(request.getRemotePort()));
  }
  if (responseBody != null) {
    response.getOutputStream().write(responseBody.getBytes(Charsets.UTF_8));
  }
}
 

Example 29

From project ajah, under directory /ajah-event-http/src/main/java/com/ajah/log/http/servlet/filter/.

Source file: AccessLoggerFilter.java

  15 
vote

/** 
 * Logs requests.
 */
@Override public void doFilter(final HttpServletRequest request,final HttpServletResponse response,final FilterChain chain) throws IOException, ServletException {
  final RequestEvent requestEvent=new RequestEvent(request);
  request.setAttribute("ajahRequestEvent",requestEvent);
  try {
    chain.doFilter(request,response);
  }
  finally {
    requestEvent.complete();
    if (isLoggable(request)) {
      log.finest(requestEvent.getUri() + " took " + requestEvent.getDuration()+ "ms");
      AjahUtils.requireParam(this.taskExecutor,"taskExecutor");
      this.taskExecutor.execute(new RequestEventHandler(requestEvent,this.requestEventManager));
    }
  }
}
 

Example 30

From project alphaportal_dev, under directory /sys-src/alphaportal/web/src/main/java/alpha/portal/webapp/filter/.

Source file: LocaleFilter.java

  15 
vote

/** 
 * This method looks for a "locale" request parameter. If it finds one, it sets it as the preferred locale and also configures it to work with JSTL.
 * @param request the current request
 * @param response the current response
 * @param chain the chain
 * @throws IOException when something goes wrong
 * @throws ServletException when a communication failure happens
 */
@Override @SuppressWarnings("unchecked") public void doFilterInternal(HttpServletRequest request,final HttpServletResponse response,final FilterChain chain) throws IOException, ServletException {
  final String locale=request.getParameter("locale");
  Locale preferredLocale=null;
  if (locale != null) {
    final int indexOfUnderscore=locale.indexOf('_');
    if (indexOfUnderscore != -1) {
      final String language=locale.substring(0,indexOfUnderscore);
      final String country=locale.substring(indexOfUnderscore + 1);
      preferredLocale=new Locale(language,country);
    }
 else {
      preferredLocale=new Locale(locale);
    }
  }
  final HttpSession session=request.getSession(false);
  if (session != null) {
    if (preferredLocale == null) {
      preferredLocale=(Locale)session.getAttribute(Constants.PREFERRED_LOCALE_KEY);
    }
 else {
      session.setAttribute(Constants.PREFERRED_LOCALE_KEY,preferredLocale);
      Config.set(session,Config.FMT_LOCALE,preferredLocale);
    }
    if ((preferredLocale != null) && !(request instanceof LocaleRequestWrapper)) {
      request=new LocaleRequestWrapper(request,preferredLocale);
      LocaleContextHolder.setLocale(preferredLocale);
    }
  }
  final String theme=request.getParameter("theme");
  if ((theme != null) && request.isUserInRole(Constants.ADMIN_ROLE)) {
    final Map<String,Object> config=(Map)this.getServletContext().getAttribute(Constants.CONFIG);
    config.put(Constants.CSS_THEME,theme);
  }
  chain.doFilter(request,response);
  LocaleContextHolder.setLocaleContext(null);
}
 

Example 31

From project ambrose, under directory /common/src/main/java/com/twitter/ambrose/server/.

Source file: APIHandler.java

  15 
vote

@Override public void handle(String target,HttpServletRequest request,HttpServletResponse response,int dispatch) throws IOException, ServletException {
  if (target.endsWith("/dag")) {
    response.setContentType(MIME_TYPE_JSON);
    response.setStatus(HttpServletResponse.SC_OK);
    Collection<DAGNode> nodes=statsReadService.getDagNodeNameMap(request.getParameter(QUERY_PARAM_WORKFLOW_ID)).values();
    DAGTransformer dagTransformer=new SugiyamaLayoutTransformer(true);
    dagTransformer.transform(nodes);
    sendJson(request,response,nodes.toArray(new DAGNode[nodes.size()]));
  }
 else   if (target.endsWith("/events")) {
    response.setContentType(MIME_TYPE_JSON);
    response.setStatus(HttpServletResponse.SC_OK);
    Integer sinceId=request.getParameter(QUERY_PARAM_SINCE) != null ? Integer.getInteger(request.getParameter(QUERY_PARAM_SINCE)) : -1;
    Collection<WorkflowEvent> events=statsReadService.getEventsSinceId(request.getParameter(QUERY_PARAM_WORKFLOW_ID),sinceId);
    sendJson(request,response,events.toArray(new WorkflowEvent[events.size()]));
  }
 else   if (target.endsWith(".html")) {
    response.setContentType(MIME_TYPE_HTML);
  }
}
 

Example 32

From project annotare2, under directory /app/web/src/main/java/uk/ac/ebi/fg/annotare2/web/server/login/.

Source file: LoginServlet.java

  15 
vote

@Override protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  log.debug("Login details submitted; validating..");
  ValidationErrors errors=new ValidationErrors();
  try {
    errors.append(authService.login(request));
    if (errors.isEmpty()) {
      log.debug("Login details are valid; Authorization succeeded");
      HOME.restoreAndRedirect(request,response);
      return;
    }
    log.debug("Login detail are invalid");
  }
 catch (  LoginException e) {
    log.debug("Authorization failed");
    errors.append(e.getMessage());
  }
  request.setAttribute("errors",errors);
  LOGIN.forward(getServletConfig().getServletContext(),request,response);
}
 

Example 33

From project any23, under directory /service/src/main/java/org/apache/any23/servlet/.

Source file: RedirectServlet.java

  15 
vote

protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  final String pathInfo=request.getPathInfo();
  final String queryString=request.getQueryString();
  if (("/".equals(pathInfo) && queryString == null)) {
    getServletContext().getRequestDispatcher("/resources/form.html").forward(request,response);
    return;
  }
  if (pathInfo.startsWith("/resources/")) {
    getServletContext().getNamedDispatcher("default").forward(request,response);
    return;
  }
  response.sendRedirect(request.getContextPath() + "/any23" + request.getPathInfo()+ (queryString == null ? "" : "?" + queryString));
}
 

Example 34

From project aranea, under directory /server/src/main/java/no/dusken/aranea/filter/.

Source file: PluginAwareUrlRewriteFilter.java

  15 
vote

@Override protected void loadUrlRewriter(FilterConfig filterConfig) throws ServletException {
  ServletContext context=filterConfig.getServletContext();
  InputStream inputStream=context.getResourceAsStream(DEFAULT_WEB_CONF_PATH);
  URL confUrl=null;
  try {
    confUrl=context.getResource(DEFAULT_WEB_CONF_PATH);
  }
 catch (  MalformedURLException e) {
    log.debug("Malformed url",e);
  }
  String confUrlStr=null;
  if (confUrl != null) {
    confUrlStr=confUrl.toString();
  }
  if (inputStream == null) {
    log.error("unable to find urlrewrite conf file at " + DEFAULT_WEB_CONF_PATH);
  }
 else {
    Conf conf=new PluginAwareConf(context,inputStream,DEFAULT_WEB_CONF_PATH,confUrlStr);
    checkConf(conf);
  }
}
 

Example 35

From project arquillian-container-openshift, under directory /openshift-express/src/main/java/org/jboss/arquillian/container/openshift/express/ping/.

Source file: DeploymentServlet.java

  15 
vote

@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String deploymentName=req.getParameter("name");
  if (deploymentName == null) {
    returnFalse(resp);
  }
  if (deploymentExists(deploymentName)) {
    returnTrue(resp);
  }
 else {
    returnFalse(resp);
  }
}
 

Example 36

From project arquillian-extension-spring, under directory /arquillian-service-integration-spring-3-int-tests/src/test/java/org/jboss/arquillian/spring/testsuite/beans/web/.

Source file: EmployeeWebInitializer.java

  15 
vote

/** 
 * {@inheritDoc}
 */
public void onStartup(ServletContext servletContext) throws ServletException {
  AnnotationConfigWebApplicationContext webContext=new AnnotationConfigWebApplicationContext();
  webContext.register(WebAppConfig.class);
  servletContext.addListener(new ContextLoaderListener(new AnnotationConfigWebApplicationContext()));
  ServletRegistration.Dynamic servletConfig=servletContext.addServlet("employee",new DispatcherServlet(webContext));
  servletConfig.setLoadOnStartup(1);
  servletConfig.addMapping("*.htm");
}
 

Example 37

From project arquillian-extension-warp, under directory /ftest/src/main/java/org/jboss/arquillian/warp/ftest/.

Source file: TestingServlet.java

  15 
vote

@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  resp.setContentType("text/html");
  PrintWriter out=resp.getWriter();
  out.write("hello there\n");
  for (  Entry<String,String[]> entry : req.getParameterMap().entrySet()) {
    out.write(entry.getKey() + " = ");
    for (    String value : entry.getValue()) {
      out.write(value);
      out.write(", ");
    }
    out.write("\n");
  }
  out.close();
}
 

Example 38

From project artifactory-plugin, under directory /src/main/java/org/jfrog/hudson/.

Source file: ArtifactoryBuilder.java

  15 
vote

/** 
 * Performs on-the-fly validation of the form field 'name'.
 * @param value This parameter receives the value that the user has typed.
 * @return Indicates the outcome of the validation. This is sent to the browser.
 */
public FormValidation doCheckName(@QueryParameter String value) throws IOException, ServletException {
  if (value.length() == 0) {
    return FormValidation.error("Please set a name");
  }
  if (value.length() < 4) {
    return FormValidation.warning("Isn't the name too short?");
  }
  return FormValidation.ok();
}
 

Example 39

From project asadmin, under directory /war-example/src/main/java/org/n0pe/mojo/examples/war/.

Source file: DumbServlet.java

  15 
vote

@Override protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  response.setContentType("text/html;charset=UTF-8");
  PrintWriter out=response.getWriter();
  try {
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet DumbServlet</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Servlet DumbServlet at " + request.getContextPath() + "</h1>");
    out.println("<p>Random Integer: " + new Random().nextInt() + "</p>");
    out.println("</body>");
    out.println("</html>");
  }
  finally {
    out.close();
  }
}
 

Example 40

From project azure-sdk-for-java-samples, under directory /WAAD.WebSSO.JAVA/java/code/samples/sample/src/main/java/.

Source file: FederationFilter.java

  15 
vote

@Override public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  if (request instanceof HttpServletRequest) {
    HttpServletRequest httpRequest=(HttpServletRequest)request;
    if (!httpRequest.getRequestURL().toString().contains(this.loginPage)) {
      ConfigurableFederatedLoginManager loginManager=ConfigurableFederatedLoginManager.fromRequest(httpRequest);
      boolean allowedUrl=Pattern.compile(this.allowedRegex).matcher(httpRequest.getRequestURL().toString()).find();
      if (!allowedUrl && !loginManager.isAuthenticated()) {
        HttpServletResponse httpResponse=(HttpServletResponse)response;
        String encodedReturnUrl=URLUTF8Encoder.encode(httpRequest.getRequestURL().toString());
        httpResponse.setHeader("Location",this.loginPage + "?returnUrl=" + encodedReturnUrl);
        httpResponse.setStatus(302);
        return;
      }
    }
  }
  chain.doFilter(request,response);
}
 

Example 41

From project azure4j-blog-samples, under directory /ACSExample/src/com/persistent/azure/acs/filter/.

Source file: AuthorizationFilter.java

  15 
vote

@Override public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest httpServletRequest=(HttpServletRequest)request;
  HttpServletResponse httpServletResponse=(HttpServletResponse)response;
  String acsToken=httpServletRequest.getParameter("wresult");
  if (null != acsToken && acsToken.trim().length() == 0) {
    acsToken=null;
  }
  if (!(httpServletRequest.getRequestURI().contains("claims.do") && acsToken != null)) {
    Cookie[] cookies=httpServletRequest.getCookies();
    Cookie currentCookie=null;
    String cookieName=resourceBundle.getString("acs.cookie.name");
    if (cookies != null && cookies.length > 0) {
      for (      Cookie c : cookies) {
        if (cookieName.equals(c.getName())) {
          currentCookie=c;
          break;
        }
      }
    }
    if (currentCookie == null) {
      StringBuffer loginURL=new StringBuffer();
      loginURL.append(resourceBundle.getString("acs.url"));
      loginURL.append("/v2/wsfederation?wa=wsignin1.0&wtrealm=");
      loginURL.append(resourceBundle.getString("acs.realm"));
      httpServletResponse.sendRedirect(loginURL.toString());
    }
 else {
      chain.doFilter(request,response);
    }
  }
 else {
    chain.doFilter(request,response);
  }
}
 

Example 42

From project b3log-latke, under directory /latke/src/main/java/org/b3log/latke/servlet/filter/.

Source file: AbstractGZIPFilter.java

  15 
vote

/** 
 * Wraps the http servlet response with GZIP if could.
 * @param request the specified request
 * @param response the specified response
 * @param chain filter chain
 * @throws IOException io exception
 * @throws ServletException servlet exception
 */
@Override public void doFilter(final ServletRequest request,final ServletResponse response,final FilterChain chain) throws IOException, ServletException {
  final HttpServletRequest httpServletRequest=(HttpServletRequest)request;
  final String requestURI=httpServletRequest.getRequestURI();
  if (shouldSkip(requestURI)) {
    LOGGER.log(Level.FINEST,"Skip GZIP filter request[URI={0}]",requestURI);
    chain.doFilter(request,response);
    return;
  }
  final String acceptEncoding=httpServletRequest.getHeader("Accept-Encoding");
  boolean supportGZIP=false;
  if (null != acceptEncoding && 0 <= acceptEncoding.indexOf("gzip")) {
    supportGZIP=true;
  }
  if (!supportGZIP) {
    LOGGER.info("Gzip NOT be supported");
    chain.doFilter(request,response);
    return;
  }
  final HttpServletResponse httpServletResponse=(HttpServletResponse)response;
  httpServletResponse.addHeader("Content-Encoding","gzip");
  httpServletResponse.addHeader("Vary","Accept-Encoding");
  chain.doFilter(request,new GZIPServletResponseWrapper(httpServletResponse));
}
 

Example 43

From project b3log-solo, under directory /core/src/main/java/org/b3log/solo/filter/.

Source file: AuthFilter.java

  15 
vote

/** 
 * If the specified request is NOT made by an authenticated user, sends  error 403.
 * @param request the specified request
 * @param response the specified response
 * @param chain filter chain
 * @throws IOException io exception
 * @throws ServletException servlet exception
 */
@Override public void doFilter(final ServletRequest request,final ServletResponse response,final FilterChain chain) throws IOException, ServletException {
  final HttpServletResponse httpServletResponse=(HttpServletResponse)response;
  final HttpServletRequest httpServletRequest=(HttpServletRequest)request;
  try {
    LoginProcessor.tryLogInWithCookie(httpServletRequest,httpServletResponse);
    final GeneralUser currentUser=userService.getCurrentUser(httpServletRequest);
    if (null == currentUser) {
      LOGGER.warning("The request has been forbidden");
      httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
      return;
    }
    final String currentUserEmail=currentUser.getEmail();
    LOGGER.log(Level.FINER,"Current user email[{0}]",currentUserEmail);
    if (users.isSoloUser(currentUserEmail)) {
      chain.doFilter(request,response);
      return;
    }
    LOGGER.warning("The request has been forbidden");
    httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
  }
 catch (  final Exception e) {
    httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);
  }
}
 

Example 44

From project banshun, under directory /banshun/web/src/test/java/com/griddynamics/banshun/web/.

Source file: NestedController.java

  15 
vote

public ModelAndView handleRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String message="Hello Spring MVC";
  ModelAndView modelAndView=new ModelAndView("testView");
  modelAndView.addObject("message",message);
  return modelAndView;
}
 

Example 45

From project BeeQueue, under directory /src/org/beequeue/buzz/.

Source file: BuzzHandler.java

  15 
vote

@Override public void handle(String target,Request r,HttpServletRequest req,HttpServletResponse res) throws IOException, ServletException {
  BuzzContext ctx=new BuzzContext(target,r,req,res,this);
  BuzzResourceController[] buzzRCs=ctx.getResourceController();
  try {
    boolean process=false;
    for (int i=0; i < buzzRCs.length; i++) {
      if (process=buzzRCs[i].process(ctx)) {
        break;
      }
    }
    if (!process) {
      BuzzServer.processError(ctx,HttpServletResponse.SC_NOT_FOUND,"Resource not found","No applicable resource controller",null,null);
    }
  }
 catch (  BuzzException e) {
    BuzzServer.processError(ctx,e.statusCode,e.getMessage(),e.toString(),Throwables.toString(e),null);
  }
catch (  Exception e) {
    BuzzServer.processError(ctx,HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"Internal Error",e.toString(),Throwables.toString(e),null);
  }
}
 

Example 46

From project BlameSubversion-plugin, under directory /src/main/java/hudson/scm/.

Source file: BlameSubversionTagAction.java

  15 
vote

/** 
 * Invoked to actually tag the workspace.
 */
public synchronized void doSubmit(StaplerRequest req,StaplerResponse rsp) throws IOException, ServletException {
  getACL().checkPermission(getPermission());
  MultipartFormDataParser parser=new MultipartFormDataParser(req);
  Map<SvnInfo,String> newTags=new HashMap<SvnInfo,String>();
  int i=-1;
  for (  SvnInfo e : tags.keySet()) {
    i++;
    if (tags.size() > 1 && parser.get("tag" + i) == null)     continue;
    newTags.put(e,parser.get("name" + i));
  }
  UserProvidedCredential upc=null;
  if (parser.get("credential") != null)   upc=UserProvidedCredential.fromForm(req,parser);
  new TagWorkerThread(newTags,upc,parser.get("comment")).start();
  rsp.sendRedirect(".");
}
 

Example 47

From project brix-cms, under directory /brix-demo/src/main/java/org/brixcms/demo/web/dav/.

Source file: SimpleServlet.java

  15 
vote

@Override public synchronized SessionProvider getSessionProvider(){
  final SessionProvider original=super.getSessionProvider();
  return new SessionProvider(){
    public Session getSession(    HttpServletRequest request,    Repository rep,    String workspace) throws LoginException, ServletException, RepositoryException {
      final String key=Brix.NS_PREFIX + "jcr-session";
      BrixSession s=(BrixSession)request.getAttribute(key);
      if (s == null) {
        s=EventUtil.wrapSession(original.getSession(request,rep,workspace));
        for (        Plugin p : getBrix().getPlugins()) {
          if (p instanceof SessionAwarePlugin) {
            ((SessionAwarePlugin)p).onWebDavSession(s);
          }
        }
        request.setAttribute(key,s);
      }
      return s;
    }
    public void releaseSession(    Session session){
      original.releaseSession(EventUtil.unwrapSession(session));
    }
  }
;
}
 

Example 48

From project CampusLifePortlets, under directory /src/main/java/org/jasig/portlet/campuslife/mvc/.

Source file: AggregationAwareFilterBean.java

  15 
vote

@Override public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  if (this.elementsProvider.getIncludedType((HttpServletRequest)request) == Included.AGGREGATED) {
    if (logger.isDebugEnabled()) {
      logger.debug("Aggregation enabled, delegating to filter: " + this.filter);
    }
    this.filter.doFilter(request,response,chain);
  }
 else {
    if (logger.isDebugEnabled()) {
      logger.debug("Aggregation disabled, skipping filter: " + this.filter);
    }
    chain.doFilter(request,response);
  }
}