<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)航:
     
    主站蜘蛛池模板: aa级一级天堂片免费观看| 久久成人免费播放网站| 精品国产一区二区三区免费看| 亚洲精品视频免费在线观看| 精品无码人妻一区二区免费蜜桃| 亚洲AV无码不卡在线播放| 日韩电影免费在线观看网站| 国产亚洲精品岁国产微拍精品| 水蜜桃视频在线观看免费播放高清 | 亚洲伦理一区二区| 99视频有精品视频免费观看| 亚洲美女色在线欧洲美女| 无码国产精品一区二区免费| 亚洲七久久之综合七久久| 国产精品成人四虎免费视频| 免费大片av手机看片高清| 久久亚洲色一区二区三区| 一区二区三区福利视频免费观看| 亚洲欧洲校园自拍都市| 性短视频在线观看免费不卡流畅 | 日本免费一二区在线电影| 精品亚洲成A人在线观看青青| 亚洲国产精品不卡毛片a在线| 日批视频网址免费观看| 久久亚洲中文字幕精品有坂深雪| 久久久久久久91精品免费观看| 亚洲免费综合色在线视频| MM131亚洲国产美女久久| 亚洲免费精彩视频在线观看| 亚洲色大成网站www永久男同| 亚洲国产成人久久一区久久| 久久青草精品38国产免费| xxx毛茸茸的亚洲| 亚洲国产精品无码久久九九| 在线日本高清免费不卡| 九九精品国产亚洲AV日韩| 亚洲动漫精品无码av天堂| 99视频在线精品免费观看6| 大妹子影视剧在线观看全集免费| 亚洲日本在线免费观看| 亚洲欧洲精品成人久久曰影片 |