GWT的Context Path问题

1. 在GWT的JAVA代码里取得Context Path

  

        //若生成的JS所在目录为war/moduleName
          path = GWT.getModuleBaseURL().replace("/" + GWT.getModuleName(),"");
	 

        //若生成的JS所在目录为war/gwt/moduleName
        path = GWT.getModuleBaseURL().replace("/gwt" + "/" +      GWT.getModuleName(), "");
 

2.在module xml里引用context path下的css文件时,用“..”来代表上级目录

    

     

 <stylesheet src="../stylesheet/xxx.css" />

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.