Fields not working then application runs as Runnable WAR
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
If application runs from runnable WAR (```java -jar app.war```) the plugin doesn't work,
test project https://github.com/yurib/TestGrailsFieldsPluginWar
Steps to reproduce:
1. Create application and one domain object in it
```
>grails create-app TestGrailsFieldsPluginWar
>cd TestGrailsFieldsPluginWar/
grails> create-domain-class Author
grails> create-domain-class Author
grails> create-scaffold-controller Author
```
Add *name* and *age* properties
Create custom field renders for the name:
```
ls grails-app/views/_fields/Author/name/
_displayWidget.gsp _displayWrapper.gsp _widget.gsp _wrapper.gsp
```
Run application:
```
grails>run-app
```
Observe custom field rendering.
Build and run Runnable WAR
```
grails>assemble
cd ./build/libs/
java -Dgrails.env=dev -jar TestGrailsFieldsPluginWar-0.1.war
```
Observe that field rendering as default without plugin override.
Contributor guide
Research direction
Use the linked TestGrailsFieldsPluginWar project to reproduce the difference between grails run-app and java -Dgrails.env=dev -jar ...war. Compare the custom renderers under grails-app/views/_fields/Author/name/, including _displayWidget.gsp, _displayWrapper.gsp, _widget.gsp, and _wrapper.gsp; done means the runnable WAR uses these overrides instead of the default field rendering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100