小编Sam*_*sia的帖子

捕获包含HttpServletResponseWrapper标头的整个响应

提前感谢大家 -

所以我继续实现了这段代码: 如何读取HttpServletReponses输出流?

这给了我响应的主体(html等),但我根本没有得到任何标题 - 这可能与HttpServletResponseWrapper有关吗?我需要将所有请求捕获到所有标题修改等.

谢谢,

山姆

java jsp tomcat

4
推荐指数
1
解决办法
2416
查看次数

在firefox中启动时设置首选项

提前感谢大家 -

我需要在启动时加载任何窗口之前加载首选项.下面是我一直在使用的一些/组件代码.SetPreference方法在调用时似乎失败了(之后没有任何执行) - 我假设因为它所需的资源在执行时不可用......或者我做错了.有关此代码的任何建议或在启动时设置首选项的其他方法吗?

再次感谢,

山姆

出于某种原因,SO的代码格式无法正常工作 - 这里也是代码的链接 - http://samingrassia.com/_FILES/startup.js

Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');

const Cc = Components.classes;
const Ci = Components.interfaces;

const ObserverService = Cc['@mozilla.org/observer-service;1'].getService(Ci.nsIObserverService);

function MyStartupService() {};

MyStartupService.prototype = {
  observe : function(aSubject, aTopic, aData) {
    switch (aTopic) {
      case 'xpcom-startup':
        this.SetPreference("my.extension.is_running", "false");
        break;
      case 'app-startup':
        this.SetPreference("my.extension.is_running", "false");
        ObserverService.addObserver(this, 'final-ui-startup', false);
        break;
      case 'final-ui-startup':

        //make sure is_running is set to false
        this.SetPreference("my.extension.is_running", "false");

        ObserverService.removeObserver(this, 'final-ui-startup');
        const WindowWatcher = Cc['@mozilla.org/embedcomp/window-watcher;1'].getService(Ci.nsIWindowWatcher);
        WindowWatcher.registerNotification(this);
        break;
      case 'domwindowopened':
        this.initWindow(aSubject);
        break;
    }
  },
  SetPreference : …
Run Code Online (Sandbox Code Playgroud)

javascript xpcom firefox-addon

2
推荐指数
1
解决办法
1431
查看次数

标签 统计

firefox-addon ×1

java ×1

javascript ×1

jsp ×1

tomcat ×1

xpcom ×1