https://github.com/JonathanWalsh/Granule
最近找了這個工具來幫js/css瘦身,在tomcat 8下轉換assets file路徑會在getRealPath下產生Exception。
最近找了這個工具來幫js/css瘦身,在tomcat 8下轉換assets file路徑會在getRealPath下產生Exception。
The parameter for getRealPath() is a 'virtual path' which - unfortunately - is a concept used in the Java docs but not actually defined anywhere. It is assumed to be a path to a resource in your web application and the separator in that case is always '/' regardless of platform.
解決方法要在html頁面引用javascript file時,要多加一個/
沒有留言:
張貼留言
留個話吧:)