Webflow execution id missing when using g:link - grails

We have recently upgraded a project from grails version 2.3.11 to 2.5.5. In the process the webflow plugin was updated from 2.0.8.1 to 2.1.0.
To controll webflow I use the g:link tag, like this:
<g:link event="foo">Foo action</g:link>
Before the update, the link url was correctly build, and looked like this:
/fooaction/superflow?execution=e1s2&_eventId=foo
Since the update, the link is missing the execution parameter, and resolves like this: /fooaction/superflow?_eventId=foo
This can be fixed, by changing the links, like this:
<g:link event="foo" params="${[execution: params.execution]}">Foo action</g:link>
But this can not be a solution. I searched the web and seem to be the only one having this problem. Which indicates I made a mistake in the configuration. Maybe someone can enlighten me, what I could have missed.
I found a link on github, stating This works with <= Grails 2.4.4 but not with Grails >= 2.4.5. The execution param is missing. Is this a bug which have not been fixed ever since?
Thank you very much.

Related

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?

Grails: Unable to generate views

This is a very basic thing and I have no idea why am not able to do this. I am using Grails 2.3.5
I have a domain class com.trail.AuditTrail and I want it scaffolded views. So, here are the steps I followed:
ran grails create-controller com.trail.AuditTrail, this returned a message saying it generated:
grails-app/controller/trail/AuditTrailController
grails-app/views/auditTrail (just the folder!)
It also created AuditTrailControllerSpec.groovy.
Then I added the line static scaffold = true in the Controller.
Then ran generate-views to create the views, but nothing got created !
IMPORTANT: In fact grails says that there is no command called as generate-views. When I did grails help it didn't list generate-views. So, I thought may be 2.3.5 doesn't have the command and tried generate-all. This too failed. To my surprise, grails help didn't show up generate-all too !
Then I found this bug: https://jira.grails.org/browse/GRAILS-10530. So, I tried clean, refresh-dependencies, compile and then generate-all. But still the same problem.
I thought my local grails setup is messed up. So, asked my colleague. He too sees the same problems.
My problem is I am not able to create the default template GSPs out of the domain.
Scaffolding functionality was extracted from Grails core in 2.3, so you need to install scaffolding plugin for Grails 2.3.5 to be able to use generate-all, generate-views GANT scripts.
P.S. I suggest you to switch to Grails 2.3.6 or 2.3.7. For more details take a look at this article http://www.gopivotal.com/security/cve-2014-0053
for that right click on action then click on generate view

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.

Grails Webflow not auto-reloading

Hey all- I'm working on some web flows for a Grails app we're building. I'm (slowly) getting the hang of the webflows themselves, but progress is severely limited due to the fact that changes to the webflow controller are not auto-reloading in Tomcat on save; basically, I need to bounce the app every time I make a change. As you can imagine, this is pretty painful. I think auto-reload was working a couple of days ago and then stopped, but I'm not sure.
Has anyone else experienced this? Any thoughts on how to make auto-reload work?
Thanks!
After much trial and error, here's what I found:
Situation: I have a controller with a single webflow. The first stage of the webflow uses a command object. (Grails 1.3.1)
1) Command and Webflow in same file; Command first: everything works, but the controller will not auto-reload on save.
2) Command and Webflow in same file; Webflow first: doesn't work- a serialization exception thrown when trying to render the page that references the command object.
3) Command and Webdlow in different files: everything works and controller auto-reloads.
For now I'll just keep everything in separate files. If anyone has insight into why this behavior is being exhibited, I'm all ears.

rails plugin installation and upgrades

I have a rails plugin written in v 2.1.1. When I install it in a 2.2.2 app, it breaks the app. I'm unable to use polymorphic routes so something like
<%= link_to #object %>
Doesn't work, because it says:
ActionView::TemplateError (undefined method 'polymorphic_path' for #<ActionView::Base:0x1a95c1c>)
If I script/plugin remove the plugin, it's still broken. So I have a two part question:
What is script/plugin install doing besides just copying the files into vender/plugins. From the output after installing it, it just looks like it's copying the files over, but clearly something else is going on behind the scenes, because removing it doesn't fix the problem
What do I need to do to update this plugin for rails 2.2.2. I don't know much about plugins, but I don't see anything that has specific version code in the plugin itself, so I can't figure out what exactly is breaking and what needs to be updated. Obviously this one is kind of tough to answer without seeing the code, but it's not actually the code in the plugin that's breaking, it's the plugin that is affecting my whole rails config.
Does anyone have experience with upgrading plugins to work for newer versions of rails?
Turns out the plugin was overwriting the RouteSet::draw method and just needed to be updated to the 2.2.2 draw code :P

Resources