Weceem plugin not rendering javascript -Grails 2.3.7 - grails

I just got weceem-plugin (1.2) installed with Grails 2.3.7. Everything runs fine except javascript does not get rendered - it just shows up as raw text. I have confirmed all the static resources(css,images,js) are loaded. Thanks in advance.

I solved it. I rebuilt the plugin with the grails version I was using. Basically downloaded a copy from github, edited the dependencies to reflect the versions that my grails version comes with by default. It runs fine now - i hope it helps someone.

The problem can be solved without rebuilding existed plugin. You can try to update your Config.groovy in your application. Please, check the demo application for Weceem on GitHub, here you can find Config.groovy https://github.com/jCatalog/weceem-app/blob/master/grails-app/conf/Config.groovy . The application is on grails-2.3.7. Especially check setting:
grails.resources.adhoc.excludes = ['/plugins/weceem-1.2']
also such your settings as
grails.views.default.codec= "none"
grails.views.gsp.codecs.scriptlet = "none"

Related

How do I keep the spring-security-core login screen when using the spring-security-ui plugin

I am migrating a grails app from 2.3.4 to 3.3.9. I created a new app and am bringing in the code piece by piece. I have the "org.grails.plugins:spring-security-core:3.2.3" dependency and "org.grails.plugins:spring-security-ui:3.1.2" because I want the user/role management screens.
From my investigation both plugins include login/auth.gsp, and it seems my app is using ui instead of core, but this is not how my 2.3.4 app behaved using ":spring-security-core:2.0-RC2" and ":spring-security-ui:1.0-RC1". Is there some way to configure or force the app to use login/auth.gsp from core? If not, can I just copy the one I want into my local views folder? Would there be any compatibility issues?
I copied https://github.com/grails-plugins/grails-spring-security-core/blob/3.2.x/grails-app/views/login/auth.gsp into my views folder, and it seems to work fine and give me the results I want. There seem to be no obvious compatibility issues.

Grails 3 does not auto reload changes in my app

I'm starting with grails 3 using the Intelijdea IDE but I'm having a problem and it's that when I'm in development stage my app does not auto reload the changes made which I find a bit problematic ..
If anyone knows please help me with that problem.
I'm using grails 3.3.9 and had the same problem until I tried running my app with:
gradlew bootRun
And it worked!!
I am currently using grails 3.2.4 and auto reloading works fine. Only thing I noticed is that sometimes new methods don't get reloaded properly and will require a restart.
Maybe posting your exact grails and environment , version and details will help.

Upgrading to Grails 3.2, now JSPs will not render

I am upgrading my application from Grails version 2.3.7 to version 3.2.2. My JSPs and other content like CSS and images all had to move from the old location of "web-app" to the new location of "src/main/resources/". Now, however, my JSPs will not load like they did before. For instance, my index page has always been http://hostname/app-name/homepage.jsp, and that always loaded just fine in Grails 2.x. Maybe there is just a configuration missing or something, does anyone have a suggestion. I have read the upgrade documentation, but have not found an answer to my problem.
As Grails 3 uses Spring Boot there is no default context. So your application should be served under http://hostname:port.
You can change it back to the previous URL as suggested in How do you change the application name in Grails 3?

How do I use handlebars-asset-pipeline with Grails?

I'm close to giving up here -- there's roughly 5 different repositories with different versions of handlebars-asset-pipeline with different instructions, and I can't get any of them to work.
I'm using Grails 3.1.1 with the default build.gradle created by init-app, added handlebars-asset-pipeline 2.7 to both the buildscript and normal dependencies, and put a foo.hbs file into grails-app/assets.
Now, when running gradlew compileAssets, the templates get compiled correctly, so the plugin is doing something, but I was expecting it to also work when running the application via grails run-app. Is it wrong of me to expect that? If not, can someone be so kind as to give me a working example of how to integrate the template precompiler?
I find specifying assets instead of runtime is the thing that trips me up. I can get it to work adding the following
buildscript {
...
dependencies {
...
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.6"
}
}
apply plugin: 'com.bertramlabs.asset-pipeline'
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.3"
assets 'com.bertramlabs.plugins:handlebars-asset-pipeline:2.14.6'
I don't use it but since you use Gradle I'm quite sure you can add it as your own task with dependsOn: 'compileAssets'. Check out example for Android.

Grails upgrade from 1.3.7 to 2.0.1 -

I have upgraded my grails app from 1.3.7 to 2.0.1. I had few static (gsp but not using any controllers) pages using standard layout under "grails-app\views\" . These files were working fine prior to upgrade. But after upgrade, I get 404 error. Only index.gsp is working if I give root path ie. "http://localhost:8080/myapp/". But if I specify "http://localhost:8080/myapp/index.gsp", I get 404 error.
I assume this is something to do with grails filters in 2.0.1. But i couldn't figure it out yet. DO anyone have experienced any similar issue?
This was a security risk and directly linking to GSPs was disallowed in 2.0 - see http://jira.grails.org/browse/GRAILS-7542 and http://grails.1312388.n4.nabble.com/Direct-linking-to-gsp-in-Grails-2-0-td4228929.html for a discussion and examples of how to use URL mappings to link to GSPs.

Resources