Package com.webobjects.appserver

Examples of com.webobjects.appserver.WOResponse.headerForKey()


        for (int i=0; i<theCount; i++) {
            WOResponse aResponse = responses[i];
            MInstance anInstance = (MInstance) instArray.objectAtIndex(i);
            if (aResponse != null) {
                anInstance.updateRegistration(new NSTimestamp());
                if (aResponse.headerForKey("x-webobjects-refusenewsessions") != null) {
                    anInstance.setRefusingNewSessions(true);
                } else {
                    anInstance.setRefusingNewSessions(false);
                }
View Full Code Here


        cachedResponse.setHeader( "text/css", "content-type" );
        cache.setObjectForKey( cachedResponse, key );
        md5 = ERXStringUtilities.md5Hex( cachedResponse.contentString(), null );
        cachedResponse.setHeader( md5, "checksum" );
      }
      md5 = cachedResponse.headerForKey( "checksum" );
      NSDictionary<String, Object> query = new NSDictionary<String, Object>( md5, "checksum" );
      href = wocontext.directActionURLForActionNamed( Sheet.class.getName() + "/" + key, query, wocontext.request().isSecure(), 0, false );
    }

    response._appendContentAsciiString( "<link" );
View Full Code Here

    @Override
    public WOActionResults performActionNamed( String name ) {
      WOResponse response = ERXStyleSheet.cache( session() ).objectForKey( name );
      String md5 = ERXStringUtilities.md5Hex( response.contentString(), null );
      String queryMd5 = response.headerForKey( "checksum" );
      if (ObjectUtils.equals(md5, queryMd5)) {
        //TODO check for last-whatever time and return not modified if not changed
      }
      return response;
    }
View Full Code Here

      if (logger.isDebugEnabled()) logger.debug("Considering pageReplacementCache for " + context.request().uri() + " with contextID " + context.contextID());
      WORequest request = context.request();
      WOResponse response = context.response();
      String pageCacheKey = null;
      if (response != null) {
        pageCacheKey = response.headerForKey(ERXAjaxSession.PAGE_REPLACEMENT_CACHE_LOOKUP_KEY);
      }
      if (pageCacheKey == null && request != null) {
        pageCacheKey = request.headerForKey(ERXAjaxSession.PAGE_REPLACEMENT_CACHE_LOOKUP_KEY);
      }
View Full Code Here

      // String newSessionID = request.sessionID();
      // if (newSessionID != null) {
      // conversation.setSessionID(newSessionID);
      // }
      if (response != null) {
        String nextRequestUrl = response.headerForKey(InstantMessengerAdaptor.IM_ACTION_URL_KEY);
        conversation.setRequestUrl(nextRequestUrl);
        String responseMessage = response.contentString();
        if (responseMessage != null) {
          responseMessage = responseMessage.trim();
        }
View Full Code Here

    if (requestHandlingLog.isDebugEnabled()) {
      requestHandlingLog.debug("Returning, encoding: " + response.contentEncoding() + " response: " + response);
    }

    if (responseCompressionEnabled()) {
      String contentType = response.headerForKey("content-type");
      if (!"gzip".equals(response.headerForKey("content-encoding")) && (contentType != null) && (contentType.startsWith("text/") || responseCompressionTypes().containsObject(contentType))) {
        String acceptEncoding = request.headerForKey("accept-encoding");
        if ((acceptEncoding != null) && (acceptEncoding.toLowerCase().indexOf("gzip") != -1)) {
          long start = System.currentTimeMillis();
          long inputBytesLength;
View Full Code Here

      requestHandlingLog.debug("Returning, encoding: " + response.contentEncoding() + " response: " + response);
    }

    if (responseCompressionEnabled()) {
      String contentType = response.headerForKey("content-type");
      if (!"gzip".equals(response.headerForKey("content-encoding")) && (contentType != null) && (contentType.startsWith("text/") || responseCompressionTypes().containsObject(contentType))) {
        String acceptEncoding = request.headerForKey("accept-encoding");
        if ((acceptEncoding != null) && (acceptEncoding.toLowerCase().indexOf("gzip") != -1)) {
          long start = System.currentTimeMillis();
          long inputBytesLength;
          InputStream contentInputStream = response.contentInputStream();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.