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?
Related
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.
Need of help.
I am new to Grails,
My question is How to do db-reverse-engineer.?
I did it in Grails 2.5.1 but I am struggling with Grails 3.1.0.M2 version.
Thanks in advance.
There's no plugin for Grails 3. I started to convert the older one but it's more work than I was expecting because it has to work with Hibernate 4, and the old plugin only works with Hibernate 3.
But the generated files wouldn't be any different in Grails 3 than in Grails 2 since GORM has stayed rather consistent. Since the plugin is only used at build time, and often only once or at most a few times, I recommend that you configure a Grails 2 app with the same database config settings and using the plugin there, then moving the generated files to your Grails 3 app.
I was using ember as a part of my grails application, All libs were provided by a ember grails plugin 1.7. As I would eventually like to move to newer version I have tried both to replace ember and ember-data with newer files versions as well as to add references to hosted files, but I would always get during run:
template.buildRenderNodes is not a function
My guess from that error message would be you are still referencing handlebars rather than htmlbars which Ember now uses. You now need ember-template-compiler.js, see http://emberjs.com/builds/#/release.
As Christopher mentions, you will probably feel less pain by going up a version at a time and also moving to Ember CLI if you haven't already
Does Grails 3.0.x no longer have the ability to create wrappers anymore?
The documentation doesn't seem to have the Grails wrapper section anymore.
Is there an alternative way which we can use the gradle wrapper to execute grails commands such as create-controller?
Does Grails 3.0.x no longer have the ability to create wrappers
anymore?
No.
Is there an alternative way which we can use the gradle wrapper to
execute grails commands such as create-controller?
Not for commands like create-controller, no.
We may re-introduce grailsw. File a feature request at https://github.com/grails/grails-core/issues if you would like to track that.
The Grails wrapper is back as of Grails 3.2.3:
http://docs.grails.org/3.2.x/guide/introduction.html#whatsNewGrailsWrapper
I have an app created with Grails 3.1.x, then upgraded to Grails 3.2.6, but the files such as 'grailsw' did not appear in my project root, and I'm not sure how to get them added via some command in the project.
When I create a new app using Grails 3.2.6, the new files are in the project root (grailsw, grailsw.bat, grails-wrapper.jar). I assume they can be copied over to an app like mine: a quick test of this worked for me.
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.