When I build a war file for my Grails application via grails war it still contains some groovy files.
After the war-filed is deployed on an application server, when and how are this files compiled to java bytecode?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The templates are there for dynamic scaffolding. For example if you have a controller like this
then it’ll use the template to create a controller at runtime. This isn’t very often used in real apps – it’s more for demos and getting started – but it’s an option. The dynamically generated controller and GSPs are created based on the templates and compiled in-memory.
The groovy-all jar does have code that can compile Groovy source, but that’s because it’s the “-all” jar. Just because it’s there doesn’t mean it’s necessarily used. In general all compilation is done when building the war, including precompiling GSPs. This is for performance – you want the app to be as fast as possible in production.