<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)航:
     
    主站蜘蛛池模板: 久久久久亚洲精品中文字幕| 亚洲免费观看视频| 久久久青草青青亚洲国产免观 | 亚洲av鲁丝一区二区三区| 亚洲精品第一综合99久久| 一级黄色免费网站| 91精品免费在线观看| 精品国产亚洲一区二区在线观看| 亚洲男人的天堂久久精品| 一级特级aaaa毛片免费观看 | 亚洲男人的天堂久久精品| 9久热精品免费观看视频| 在线观看免费人成视频| 亚洲区小说区图片区QVOD| 亚洲日韩av无码中文| 国产免费阿v精品视频网址| 免费看的成人yellow视频| 久久精品国产亚洲av麻豆色欲| 看一级毛片免费观看视频| 1000部羞羞禁止免费观看视频 | 久久久久久久久亚洲 | 色窝窝亚洲AV网在线观看| 少妇太爽了在线观看免费视频| 波多野结衣中文一区二区免费| 亚洲精品国产福利片| 国产一级a毛一级a看免费视频| 日韩中文字幕在线免费观看 | 一级A毛片免费观看久久精品 | 久久久久久毛片免费看| 成全视频在线观看免费高清动漫视频下载 | 亚洲一区二区中文| 在线91精品亚洲网站精品成人| 99久久99久久精品免费看蜜桃 | 最近的中文字幕大全免费版| 亚洲AV色香蕉一区二区| 国产免费久久精品99久久| 拔擦拔擦8x华人免费久久| 亚洲制服丝袜精品久久| 亚洲一区二区在线免费观看| 亚洲伊人久久大香线蕉综合图片 | 免费在线观看自拍性爱视频|