replacing gsp-resources

28 views
Skip to first unread message

Scott Ingram

unread,
Oct 1, 2017, 3:45:28 AM10/1/17
to Grails Dev Discuss
My Grails 2.2 project uses http://grails.org/plugin/gsp-resources which I now need to replace as I am upgrading to Grails 3.1

I can't find an existing replacement.  (Is there one?)  So, I need to roll my own.

I hope to extend asset-pipeline and use grails.gsp.PageRenderer to convert myJavaScript.js.gsp into myJavaScript.js which does lots of fun things like database and GORM calls.

with this comment that concerns me: 

"In production, the asset-pipeline compiles your assets on war create."

Is the "war create" phase fully empowered with access to all the capabilities of my app, including GSP rendering, GORM, and LDAP ? 

thanks,
Scott


Sergio Michels

unread,
Oct 5, 2017, 1:21:37 PM10/5/17
to grails-de...@googlegroups.com
Hi Scott,

I've never used this plugin that you mentioned (gsp-resources), but I'm wondering how it works... Can you give an use-case for generating javascript based on a GSP with database info? Do you need to create a javascript per request, or the requisite is to generate it once on startup? 


--
Sérgio Michels

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
To post to this group, send email to grails-dev-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/18a34502-d261-45af-8e41-432d0b7f9eca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Scott Ingram

unread,
Oct 6, 2017, 5:59:20 PM10/6/17
to Grails Dev Discuss
Hi Sérgio,

In my single-page web app, my JavaScript uses a lot of static information stored the database, like countries, MPAA movie ratings, or a nested tree of movie genre/sub-genres, etc.  While there is also a lot of data that I pull over in real-time via AJAX calls, the static data goes through gsp-resources.  I have a gsp that instantiates domain objects, makes SQL select statements, etc, uses <g:tags> to format it all into JavaScript, which gsp-resources writes into dictionary.js once on startup / war-create.

thanks,
Scott

Reply all
Reply to author
Forward
0 new messages