Spring Questions and Answers – SpringSource Tool Suite

«
»

This set of Java Spring Multiple Choice Questions & Answers (MCQs) focuses on “SpringSource Tool Suite”.

1. The plugin, which provides Maven support to Eclipse
a) m2eclipse
b) m2plugin
c) plugin
d) none of the mentioned
View Answer

Answer: a
Explanation: The m2eclipse plugin, which provides Maven support to Eclipse (and thus to SpringSource Tool Suite), can do all the heavy lifting of importing your project since it is just a stock-standard Maven project.
advertisement

2. Spring Roo provides very powerful support to bootstrap most solutions.
a) True
b) False
View Answer

Answer: a
Explanation: It’s entirely possible there’s a plugin that will do the job for you.

3. A database and some sort of persistence mechanism using command:-
a) persistence setup –database HYPERSONIC_IN_MEMORY –provider HIBERNATE
b) persistence setup –database HYPERSONIC_IN_MEMORY –provider
c) persistence setup –database HYPERSONIC_IN_MEMORY
d) persistence –database HYPERSONIC_IN_MEMORY –provider HIBERNATE
View Answer

Answer: a
Explanation: Enter persistence setup as it suggests. On my console, I ended up entering the following command:
roo> persistence setup –database HYPERSONIC_IN_MEMORY –provider HIBERNATE

4. persistence setup –database HYPERSONIC_IN_MEMORY –provider HIBERNATE command creates files:-
a) src/main/resources/META-INF/persistence.xml
b) src/main/resources/META-INF/spring/database.properties
c) all of the mentioned
d) none of the mentioned
View Answer

Answer: c
Explanation: In my project, the command created two new files (src/main/resources/META-INF/persistence.xml and src/main/resources/META-INF/spring/database.properties), and it updated two files (src/main/resources/META-INF/spring/applicationContext.xml and pom.xml).
advertisement

5. The file which contains useful configuration for Hypersonic in-memory database.
a) src/main/resources/META-INF/spring/database.properties
b) src/main/resources/META-INF/persistence.xml
c) src/main/resources/META-INF/pom.xml
d) none of the mentioned
View Answer

Answer: a
Explanation: The file src/main/resources/META-INF/spring/database.properties contains useful configuration to facilitate connection to the Hypersonic in-memory database.

6. The file which is the standard JPA configuration file to enable the Hibernate-based JPA implementation.
a) src/main/resources/META-INF/spring/database.properties
b) src/main/resources/META-INF/persistence.xml
c) src/main/resources/META-INF/pom.xml
d) none of the mentioned
View Answer

Answer: b
Explanation: The file src/main/resources/META-INF/persistence.xml is the standard JPA configuration file to enable the Hibernate-based JPA implementation to do its work.

7. Spring application context, src/main/resources/META-INF/spring/applicationContext.xml consists of:-
a) Data Source
b) JPA Transaction Manager
c) JPA entity manager factory
d) All of the mentioned
View Answer

Answer: d
Explanation: Finally, the Spring application context, src/main/resources/META-INF/spring/applicationContext.xml, has been updated to have a data source, a JPA transaction manager, and a JPA entity manager factory.
advertisement

8. Command to create a Spring MVC controller that provides a UI:-
a) controller scaff –class ~.web.CustomerController –entity ~.domain.Customer
b) controller scaff –class ~.web.CustomerController –entity
c) none of the mentioned
d) all of the mentioned
View Answer

Answer: a
Explanation: Type the following command to create a Spring MVC controller that provides a UI to manipulate Customer entities (and stand back!):
controller scaff –class ~.web.CustomerController –entity ~.domain.Customer

9. To deploy the application to a web container:-
a) mvn tomcat:run
b) mvn jetty:run
c) all of the mentioned
d) none of the mentioned
View Answer

Answer: c
Explanation: In the project directory, in the standard shell, run mvn tomcat:run or mvn jetty:run, and open http://localhost:8080 in your browser.

10. Spring Roo’s root folder (or any of the source packages) is:-
a) src/main/java, src/main/resources
b) src/test/java
c) src/test/resources
d) all of the mentioned
View Answer

Answer: d
Explanation: The root folder (or any of the source packages, e.g., src/main/java, src/main/resources, src/test/java, or src/test/resources).
advertisement

Sanfoundry Global Education & Learning Series – Java Spring.
To practice all areas of Java Spring, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn