Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide samples with "Groovy" TLDs #3

Open
rwinch opened this issue Apr 29, 2014 · 8 comments
Open

Provide samples with "Groovy" TLDs #3

rwinch opened this issue Apr 29, 2014 · 8 comments

Comments

@rwinch
Copy link

rwinch commented Apr 29, 2014

Many users trying GSPs with boot will be doing so for the first time. One of GSPs strengths is the extensive TLD definitions. For those that are not new to Grails, integrating with Boot will certainly be new. It would be real cool to see an example of using some of the TLD extensions. A few tags that come to mind are:

  • Fields Plugin <f:all bean="person"/>
  • Paginate <g:paginate controller="book" action="list" total="${bookCount}" />

Please keep in mind that I am not a Grails expert, so these libraries are simply suggestions. The point is to demo some of the coolest GSP libraries out there.

Not knowing the code internals I suppose it is possible some libraries will not work with Boot. I think trying to ensure (or work towards) the entire ecosystem is available will be very valuable.

@graemerocher
Copy link
Member

Many of these tag libraries are unfortunately tied into Grails specific APIs around URL mappings (to controllers and actions) and domain classes. Since Spring Boot doesn't have a standard "domain model" or a URL Mapping infrastructure to reverse generated links from routes these kinds of tags will simply not work with Spring Boot alone :(

@rwinch
Copy link
Author

rwinch commented May 5, 2014

Thanks for the reply. Being able to use additional GSP taglibs seems like it would greatly enhance the user experience. I wonder what it would take for Spring MVC to support such an API. What do you think @rstoyanchev ?

@graemerocher
Copy link
Member

@rwinch You can obviously use the existing Spring JSP tag libraries, but it may well be worth considering building out a set of standard GSP tag libraries for Spring Boot. The Boot team would need to drive that though as I don't know what tags are needed necessarily...

@rwinch
Copy link
Author

rwinch commented May 6, 2014

Would it be worth while trying to provide Spring MVC APIs around URL mappings that you mention? Are there other limitations in using Grails taglibs with standard Spring?

@graemerocher
Copy link
Member

@rwinch Could be worthwhile yeah. In Grails we have:

https://github.com/grails/grails-core/blob/master/grails-web-url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/UrlCreator.java

Which is what is needed.

Other limitations are a standard API around what is the domain model (classes, properties, associations). In Grails we have this. See

https://github.com/grails/grails-data-mapping/blob/master/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/model/MappingContext.java

Which allows you to write tag libraries like the "fields" one you mentioned, for auto generating forms from the domain model.

@rstoyanchev
Copy link

Sorry for noticing this late. It's actually quite relevant to 4.1. The latest code in master has support for associating names with @RequestMapping methods and the MvcUriComponentsBuilder than allows you reverse engineer the link from its name. See https://jira.spring.io/browse/SPR-5779 for details. The strategy for assigning names is pluggable.

@dsyer
Copy link

dsyer commented May 22, 2014

Great, so we can maybe get better GSP tag library coverage in Spring 4.1. But isn't it possible to use some taglibs out of the box (the ones that don't need that metadata I guess)? Maybe there aren't any useful ones.

@graemerocher
Copy link
Member

@dsyer There are several useful ones that useable like render, applyLayout etc. for layouts/templates and then all of the logical ones each, if, where, set etc.

It is just anything that relies on Grails specific APIs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants