<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    samtiger


    QQ:418148757
    Name:yangchuan
    數(shù)據(jù)加載中……
    struts2的小bug

    struts2.1.6的時候,有編碼問題,主要是因為他把設(shè)置編碼的那行代碼沒放在最前面。
    struts2.2.1的時候,又出來一個低級bug,那就是一直以來模板的加載都是先查找web.xml中查抄templatePath的配置值,然后才從web應(yīng)用目錄查找,最后才是從class和jar中查找。結(jié)果在2.2.1中就犯了一個低級bug,那就是永遠找不到web應(yīng)用目錄中,代碼在:org.apache.struts2.views.freemarker.FreemarkerManager.class中
        
    public void init(ServletContext servletContext) throws TemplateException {
        this.config = createConfiguration(servletContext);

        this.config.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER);
        this.contentType = "text/html";

        this.wrapper = createObjectWrapper(servletContext);
        if (LOG.isDebugEnabled())
          LOG.debug("Using object wrapper of class " + this.wrapper.getClass().getName(), new String[0]);

        this.config.setObjectWrapper(this.wrapper);

        this.templatePath = servletContext.getInitParameter("TemplatePath");
        if (this.templatePath == null)
          this.templatePath = servletContext.getInitParameter("templatePath");

        if (this.templatePath == null)
          this.templatePath = "class://";
        this.config.setTemplateLoader(createTemplateLoader(servletContext, this.templatePath));

        loadSettings(servletContext);
      }
        
    protected TemplateLoader createTemplateLoader(ServletContext servletContext, String templatePath)
      {
        TemplateLoader templatePathLoader = null;
        try
        {
          if (templatePath.startsWith("class://"))
          {
            templatePathLoader = new ClassTemplateLoader(super.getClass(), templatePath.substring(7));
          } else if (templatePath.startsWith("file://"))
            templatePathLoader = new FileTemplateLoader(new File(templatePath));
        }
        catch (IOException e) {
          LOG.error("Invalid template path specified: " + e.getMessage(), e, new String[0]);
        }

        if (templatePathLoader != null);
        return new MultiTemplateLoader(new TemplateLoader[] { new WebappTemplateLoader(servletContext), new StrutsClassTemplateLoader() });
      }

    不過,這個問題已經(jīng)在2.3的版本中修復(fù)過來了。

    posted on 2012-04-10 23:13 sam.chuan.yang 閱讀(841) 評論(1)  編輯  收藏

    評論

    # re: struts2的小bug 2013-01-22 12:56 123213

    aaaaaaaaaaaaaaaaaaaaaaadddddddddd
      回復(fù)  更多評論    

    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 亚洲人成网站观看在线播放| 亚洲成亚洲乱码一二三四区软件| 美女免费视频一区二区三区| 久久久久久A亚洲欧洲AV冫| 99久在线国内在线播放免费观看| 亚洲中文无码卡通动漫野外| 亚洲一区二区三区在线播放| 亚洲免费观看在线视频| 老司机午夜在线视频免费观| 亚洲人成电影在线天堂| 国产精品久久香蕉免费播放| 日本免费一区二区三区| 色九月亚洲综合网| 亚洲尹人九九大色香蕉网站 | 女人18毛片a级毛片免费| CAOPORM国产精品视频免费| 亚洲一卡二卡三卡| 亚洲人成色7777在线观看| 午夜视频免费观看| 91青青青国产在观免费影视| 日韩在线视频免费| 在线aⅴ亚洲中文字幕| 亚洲欧洲免费视频| 亚洲精品国产福利一二区| 啦啦啦中文在线观看电视剧免费版 | 成人亚洲综合天堂| 中文字幕乱码免费视频| 国产一二三四区乱码免费| WWW国产亚洲精品久久麻豆| 亚洲大片免费观看| 久久久无码精品亚洲日韩蜜桃 | 永久免费的网站在线观看| 一区二区三区观看免费中文视频在线播放 | 在线a亚洲老鸭窝天堂av高清| 久久精品亚洲视频| 自拍偷自拍亚洲精品情侣| 免费精品国产自产拍观看| 在线A级毛片无码免费真人| 成人免费黄色网址| 最近中文字幕完整免费视频ww| 中文无码日韩欧免费视频|