regex,spring,spring-mvc,spring-boot,webjars
The original code in the docs wasn't prepared for the extra slashes, sorry for that! Please try this code instead: @ResponseBody @RequestMapping(value="/webjarslocator/{webjar}/**", method=RequestMethod.GET) public ResponseEntity<Resource> locateWebjarAsset(@PathVariable String webjar, HttpServletRequest request) { try { String mvcPrefix = "/webjarslocator/" + webjar + "/"; String mvcPath = (String) request.getAttribute( HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE); String fullPath =...
java,playframework,guice,webjars,playframework-2.4
This was a problem in sbt-web. They've increased the limit: https://github.com/sbt/sbt-web/issues/104
javascript,angularjs,requirejs,webjars
I looked into the sources of requirejs. Here's what I found: requirejs splits each path, you defined in the config object, into its components (i.e. the directories, the filename and the extension). For some reason (node module naming conventions) the last extension is dropped. They do not check if that's...
jquery,scala,playframework,webjars
The WebJar locator is finding multiple files in the classpath that match the jquery.min.js search path. You should check your classpath to see what else contains a file that would match that query and the remove whatever is causing the duplicate file.
requirejs,webjars,requirejs-optimizer,playframework-2.4
It turns out that RequireJS optimization support does not apply to all Webjars, but rather limited to Classic Webjars. Even then, a webjar build file has to be included with the regular module in order for rjs to work. If you look at the jQuery classic webjar, for example, you...
jquery,maven,requirejs,webjars
The only solution I found (which is a workaround) is playing woth "enforceDefine" value: requirejs.config({ enforceDefine : false, map : { 'libs/jquery' : { 'jquery' : "webjars/jquery/${jquery.version}/jquery" }, '*': { 'jquery' : 'libs/jquery', }, }, baseUrl : './', deps : [ 'MyMainPanel' ], }); I don't know why it works,...
playframework,playframework-2.3,webjars
The easiest way to see the contents of WebJars is on http://www.webjars.org You can see that there are in fact two instances of react.js in the WebJar. So if you want to use the locator you need to be more specific about the path. But in this case I'd recommend...
requirejs,playframework-2.3,webjars
The WebJars Play2 Activator Template has all of this stuff working in it. So you should compare what you have with what is in there. I think that data-main="@routes.Assets.versioned("js/koapp/js_init")" needs to include the .js extension, like: data-main="@routes.Assets.versioned("js/koapp/js_init.js")". Also, the /vassets route should be: GET /vassets/*file controllers.Assets.versioned(path="/public", file: Asset) Notice the...
javascript,spring,requirejs,webjars
The webjars-requirejs.js files are legacy artifacts. The newer RequireJS metadata is in the WebJar's pom.xml file. The webjars-locator library has some RequireJS utilities that make it easy to work with this metadata. The WebJar Docs include some details on how to use this.
scala,playframework,requirejs,reactjs,webjars
This is not the easiest thing to do, but I was able to pull it off. I will give you some tips here. I also uploaded my own project to github. This is a very simple snake game built using React and RequireJs. It based on Webjars and Play Framework....
playframework,reactjs,playframework-2.3,webjars
There are in fact two instances of react.js in the WebJar. So if you want to use the locator you need to be more specific about the path. Before webjars-play version 2.3.0-3 there isn't an single method call way to do this so you can do one of the following:...
playframework,playframework-2.3,webjars
Versioned assets allow you to add some optimizations to your static asset loading - e.g. 304 Not Modified and far-future expires. For more info check out my Optimizing Static Asset Loading with Play Framework blog.