<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在线资源| a级毛片无码免费真人久久| 91精品免费观看| 国产亚洲av片在线观看18女人| 激情内射亚洲一区二区三区爱妻| 两个人的视频www免费| 亚洲福利精品电影在线观看| youjizz亚洲| 亚洲啪啪免费视频| 亚洲国产一区国产亚洲| 三年片在线观看免费观看大全中国| 日韩一区二区a片免费观看| 亚洲免费观看网站| 成熟女人牲交片免费观看视频| 亚洲人成图片网站| 国产美女无遮挡免费视频| 黄色a三级免费看| 日本亚洲国产一区二区三区| a毛片免费观看完整| 久久久久亚洲AV无码专区体验| 色片在线免费观看| 国内成人精品亚洲日本语音 | 亚洲色四在线视频观看| 久久成人a毛片免费观看网站| 亚洲网红精品大秀在线观看| 99精品全国免费观看视频| 老牛精品亚洲成av人片| 国产日产亚洲系列| 222www免费视频| 蜜臀亚洲AV无码精品国产午夜.| 亚洲综合国产精品第一页| 美女内射毛片在线看免费人动物| 亚洲综合av一区二区三区不卡| 亚洲国产精品人人做人人爽| 久久午夜免费鲁丝片| 亚洲日本天堂在线| 亚洲国产精品一区二区成人片国内| AA免费观看的1000部电影| 乱爱性全过程免费视频| 亚洲无成人网77777| 亚洲精品一级无码中文字幕|