Java Spring Multiple Choice Questions & Answers (MCQs) on “Grails Application and Plug ins”.
1. Grails is a self-contained framework that comes with various scripts to automate the creation of Java applications.
a) True
b) False
Answer: a
Clarification: In this sense, you simply need to unpack the distribution and perform a few installation steps in order to create Java applications on your workstation.
2. To invoke Grails operations from anywhere on your workstation.
a) GRAILS HOME
b) PATH
c) All of the mentioned
d) None of the mentioned
Answer: c
Clarification: After you unpack Grails on your workstation, define two environment variables on your operating system: GRAILS HOME and PATH.This allows you to invoke Grails operations from anywhere on your workstation.
3. To see Grails numerous commands.
a) grails help
b) grails -help
c) grails -h
d) help grails
Answer: a
Clarification: If you execute the command grails help from any directory on your workstation, you should see Grails numerous commands.
4. To create a Grails application, command:-
a) grails create-app
b) grails create-app grailsappname
c) grails create-app default
d) none of the mentioned
Answer: b
Clarification: To create a Grails application, invoke the following command wherever you wish to create an application: grails create-app grailsappname.
5. Working directories and files are placed under which directory.
a) User’s home directory under the name.grails/grails version/.
b) WEB-APP
c) WEB-INF
d) None of the mentioned
Answer: a
Clarification: Grails also creates a series of working directories and files (i.e., not intended to be modified directly) for an application. These working directories and files are placed under a user’s home directory under the name.grails/grails version/.
6. Grails generates a series of files and directories which includes.
a) Apache Ant file(build.xml)
b) Apache Ivy file(ivy.xml)
c) All of the mentioned
d) None of the mentioned
Answer: c
Clarification: Grails generates a series of files and directories that are common in most Java applications. This includes, an Apache Ant file (build.xml) and an Apache Ivy file (ivy.xml), as well as common directories like src for placing source code files and a web-app.
7. Used to define an application’s properties.
a) application.properties
b) build.xml
c) manifest.xml
d) court.iml
Answer: a
Clarification: Used to define an application’s properties, including the Grails version, servlet version, and an application’s name.
8. An Apache Ant script with a series of predefined tasks designed to create a Grails application.
a) application.properties
b) build.xml
c) manifest.xml
d) court.iml
Answer: b
Clarification: An Apache Ant script with a series of predefined tasks designed to create a Grails application.
9. An XML file containing configuration parameters for an application.
a) application.properties
b) build.xml
c) manifest.xml
d) court.iml
Answer: d
Clarification: An XML file containing configuration parameters for an application, such as directory locations and treatment of JARs.
10. An XML file containing configuration parameters for an application’s deployment.
a) application.properties
b) build.xml
c) court.iws
d) court.iml
Answer: c
Clarification: An XML file containing configuration parameters for an application’s deployment, such as web container port and project views.
11. An XML file containing configuration parameters for an application’s launch.
a) application.properties
b) build.xml
c) court.iws
d) court.launch
Answer: d
Clarification: An XML file containing configuration parameters for an application’s launch, such as JVM arguments.
12. An Apache Ivy configuration file used for defining repositories.
a) application.properties
b) ivysettings.xml
c) court.iws
d) court.launch
Answer: b
Clarification: An Apache Ivy configuration file used for defining repositories in order to download dependencies.
13. A directory containing the core of an application.
a) application.properties
b) ivysettings.xml
c) court.iws
d) grails-app
Answer: d
Clarification: A directory containing the core of an application, which further
contains the following folders:
1. conf: A directory containing an application’s configuration sources
2. controllers: A directory containing an application’s controllers files
3. domain: A directory containing an application’s domain files
4. i18n: A directory containing an application’s internationalization (i18n) files
5. services: A directory containing an application’s service files
6. taglib: A directory containing an application’s tag libraries
7. utils: A directory containing an application’s utility files
8. views: A directory containing an application’s view files
14. An XML file containing configuration parameters for an application.
a) application.properties
b) ivysettings.xml
c) court.iml
d) court.launch
Answer: c
Clarification: An XML file containing configuration parameters for an application, such as directory locations and treatment of JARs.
15. Some of the more popular Grails plugins follow:
a) App Engine
b) Quartz
c) Spring WS
d) All of the mentioned
Answer: d
Clarification:
• App Engine: Integrates Google’s App Engine SDK and tools with Grails.
• Quartz: Integrates the Quartz Enterprise Job Scheduler to schedule jobs and have
them executed using a specified interval or cron expression
• Spring WS: Integrates and supports the provisioning of web services, based on the
Spring Web Services project
• Clojure: Integrates Clojure and allows Clojure code to be executed in Grails
artifacts