SlideShare una empresa de Scribd logo
1 de 7
1ចងក្រងដោយ: ថនសារិ
រំលឹរដេដរៀនSpring Framworkក្រលងឆមាសដលើរទី២ឆ្ន ាំទី៤ររិញ្ញា រ័ក្រព័រមានវិទា
I. Multiple Choice Question
1. Which are the modules of core container?
A. Beans, Core, Context, SpEL
B. Core, Context, ORM, Web
C. Core, Context, Aspects, Test
D. Bean, Core, Context, Test
2. What is a Singleton scope?
A. The scopes the bean definition to a single instance per Spring loC container.
B. The scopes the bean definition to a single instance per HTTP Request.
C. The scopes the bean definition to a single instance per HTTP session.
D. The scopes the bean definition to a single instance per HTTP application/Global session.
3. How to you turn on annotation wiring?
A. Add<annotation-context:config/> to bean configuration
B. Add<annotation-config/> to bean configuration
C. Add<annotation-context-config/> to bean configuration
D. Add<context:annotion-config/> to bean configuration
4. What is a Spring MVC framework?
A. Spring MVC framework is a Model-Value-Class architecture and use to bind model data
with values.
B. The Spring web MVC framework provides model-view-controller architecture and ready
component that can be used to develop flexible and loosely coupled web applications.
C. Spring MVC framework is used for transaction management for web application.
D. Spring MVC framework is used for APO for web application
5. What is ACID in transactional management?
A. Accurate, Controlled, Isolation, Durability
B. Atomicity, Consistency ,Independent, Done
C. Atomicity, Consistency, Isolation, Durability
D. Accurate, Controlled, Independent, Done
6. Can you inject null and empty String values to Spring?
A. Yes
7. What is @Controller annotation?
A. The @Controller annotation indicates that a particular class serves the role of controller.
B. The @Controller annotation indicates how to control the transaction management.
C. The @Controller annotation indicates how to control the dependency injection.
D. The @Controller annotation indicates how to control the aspect Programming.
8. What is request scope?
A. This scopes a bean definition to an HTTP request.
B. This scopes the bean definition to Spring LoC container
C. This scopes the bean definition to HTTP session
D. This scopes the bean definition HTTP Application/ Global session
2ចងក្រងដោយ: ថនសារិ
9. Which of the following is correct about dependency injection?
A. It helps in decoupling application object from each other.
B. It helps in deciding the dependencies of objects.
C. It store objects states in database.
D. It store objects states in files system.
10. What AOP stands for?
A. Aspect Oriented Programming
B. Any Object Programming
C. Asset Oriented Programming
D. Asset Oriented Protocol
3ចងក្រងដោយ: ថនសារិ
II. Answer the Question
1. What is Apache Maven and Gradle?
 Apache Maven is a software project management and comprehension tool. Based on
the concept of a project object model (POM), Maven can manage a project's build,
reporting and documentation from a central piece of information.
 Gradle is an open-source build automation system that builds upon the concepts of
Apache Ant and Apache Maven and introduces a Groovy-based domain-specific
language (DSL) instead of the XML form used by Apache Maven for declaring the
project configuration.
2. What is Web.XML(Web deployment descriptor) use for in spring framework?
 web.xml is a deployment descriptor file while using J2EE. ... Servlet to be accessible
from a browser, then must tell the servlet container what servlets to deploy, and what
URL's to map the servlets to. This is done in the web.xml file of your
Java web application
3. What is <annotation-driven/> tag use for in spring configuration?
 <annotation-driven> is used to detect the annotation like @Controller,
@ResponseBody,….
4. List of 3 type of ViewResolver in spring framework and their usage?
 AbstractCachingViewResolver : Abstract view resolver that caches views. Often views
need preparation before they can be used; extending this view resolver provides
caching.
 XmlViewResolver : Implementation of ViewResolver that accepts a configuration file
written in XML with the same DTD as Spring’s XML bean factories. The default
configuration file is /WEB-INF/views.xml.
 ResourceBundleViewResolver : Implementation of ViewResolver that uses bean
definitions in a ResourceBundle, specified by the bundle base name. Typically you
define the bundle in a properties file, located in the classpath. The default file name
is views.properties.
 UrlBasedViewResolver : Simple implementation of the ViewResolver interface that
effects the direct resolution of logical view names to URLs, without an explicit
mapping definition. This is appropriate if your logical names match the names of your
view resources in a straightforward manner, without the need for arbitrary mappings.
 InternalResourceViewResolver : Convenient subclass of UrlBasedViewResolver that
supports InternalResourceView (in effect, Servlets and JSPs) and subclasses such as
JstlView and TilesView. You can specify the view class for all views generated by this
resolver by using setViewClass(..).
 VelocityViewResolver/FreeMarkerViewResolver : Convenient subclass of
UrlBasedViewResolver that supports VelocityView (in effect, Velocity templates) or
FreeMarkerView ,respectively, and custom subclasses of them.
 ContentNegotiatingViewResolver : Implementation of the ViewResolver interface
that resolves a view based on the request file name or Accept header.
4ចងក្រងដោយ: ថនសារិ
5. Describe annotation bellow with example:
-@Controller
@Controller is similar annotation which mark a class as request handler.
package com.howtodoinjava.web;
@Controller
public class HomeController
{
@GetMapping("/")
public String homeInit(Model model) {
return "home";
}
}
-@Service
@Service is a stereotype for the service layer.
Package com.in28minutes.login
inport org.springframwork.beans.factory.annotation.autowired;
@Controller
public class loginController{
@Autowired
LoginService Service;
@RequestMapping(value="/login",method=RequestMethod.GET)
public String showLoginPage(){
return "login";
}
}
-@Repository
@Repository is a stereotype for persistence layer.
package com.spring.anno;
@Service
public class TestBean
{
public void m1()
{
//business code
}
}
package com.spring.anno;
@Repository
public class TestBean
{
public void update()
{
//persistence code
}
5ចងក្រងដោយ: ថនសារិ
}
-@Rest Controller
@Rest Controller which is a convenience annotation that does nothing more than add the
@Controller and @ResponseBody annotations.
@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Controller
@ResponseBody
public @interface RestController
-@Request Mapping
@RequestMapping is one of the most common annotation used in Spring Web applications.
This annotation maps HTTP requests to handler methods of MVC and REST controllers.
@RequestMapping(value = "/ex/foos", method = RequestMethod.GET)
@ResponseBody
public String getFoosBySimplePath() {
return "Get some Foos";
}
-@Path Variable
@PathVariableannotation used to get variable name and its value at controller end. e.g.
@RequestMapping(value = "/ex/foos/{fooid}/bar/{barid}", method = GET)
@ResponseBody
public String getFoosBySimplePathWithPathVariables
(@PathVariable long fooid, @PathVariable long barid) {
return "Get a specific Bar with id=" + barid +
" from a Foo with id=" + fooid;
}
-@RequestParam
The @RequestParam annotation is used with @RequestMapping to bind a web request
parameter to the parameter of the handler method.
The @RequestParam annotation can be used with or without a value. The value specifies
the request param that needs to be mapped to the handler method parameter, as shown
in this code snippet.
The default value of the @RequestParam is used to provide a default value when the
request param is not provided or is empty.
@RestController
@RequestMapping("/home")
public class IndexController {
@RequestMapping(value = "/fetch", params = {"personId=10"})
6ចងក្រងដោយ: ថនសារិ
String getParams(@RequestParam("personId") String id){
return "Fetched parameter using params attribute = "+id;
}
@RequestMapping(value = "/fetch", params = {"personId=20"})
String getParamsDifferent(@RequestParam("personId") String id){
return "Fetched parameter using params attribute = "+id;
}
}
-@Model Attribute
@ModelAttribute is an annotation that binds a method parameter or method return
value to a named model attribute and then exposes it to a web view.
@ModelAttribute("person")
public Person getPerson(){
return new Person();
}
-@Request Header
@RequestHeader that can be used to map controller parameter to request header value
@Controller
public class HelloController {
@RequestMapping(value = "/hello.htm")
public String hello(@RequestHeader(value="User-Agent") String userAgent)
//..
}
}
-@Request Body
@Request Body is Annotation indicating a method parameter should be bound to the body
of the HTTP request.
@RequestMapping(path = "/something",method = RequestMethod.PUT)
public void handle(@RequestBody String body, Writer writer) throws IOException {
writer.write(body);
}
-@Response Body
The @ResponseBody annotation can be put on a method and indicates that the return
type should be written straight to the HTTP response body (and not placed in a Model, or
interpreted as a view name).
@RequestMapping(path = "/something",method = RequestMethod.PUT)
7ចងក្រងដោយ: ថនសារិ
public @ResponseBody String helloWorld() {
return "Hello World";
}

Más contenido relacionado

La actualidad más candente

香港六合彩
香港六合彩香港六合彩
香港六合彩iewsxc
 
.NET Core, ASP.NET Core Course, Session 8
.NET Core, ASP.NET Core Course, Session 8.NET Core, ASP.NET Core Course, Session 8
.NET Core, ASP.NET Core Course, Session 8aminmesbahi
 
SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3Ben Abdallah Helmi
 
Leverage Hibernate and Spring Features Together
Leverage Hibernate and Spring Features TogetherLeverage Hibernate and Spring Features Together
Leverage Hibernate and Spring Features TogetherEdureka!
 
.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13aminmesbahi
 
Web Application Deployment
Web Application DeploymentWeb Application Deployment
Web Application Deploymentelliando dias
 
R12 d49656 gc10-apps dba 10
R12 d49656 gc10-apps dba 10R12 d49656 gc10-apps dba 10
R12 d49656 gc10-apps dba 10zeesniper
 
Athena java dev guide
Athena java dev guideAthena java dev guide
Athena java dev guidedvdung
 
Jsp standard tag_library
Jsp standard tag_libraryJsp standard tag_library
Jsp standard tag_libraryKP Singh
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySqlkamal kotecha
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3Ben Abdallah Helmi
 
Spring design-juergen-qcon
Spring design-juergen-qconSpring design-juergen-qcon
Spring design-juergen-qconYiwei Ma
 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Examplekamal kotecha
 
24 collections framework interview questions
24 collections framework interview questions24 collections framework interview questions
24 collections framework interview questionsArun Vasanth
 

La actualidad más candente (20)

香港六合彩
香港六合彩香港六合彩
香港六合彩
 
Spring tutorial
Spring tutorialSpring tutorial
Spring tutorial
 
.NET Core, ASP.NET Core Course, Session 8
.NET Core, ASP.NET Core Course, Session 8.NET Core, ASP.NET Core Course, Session 8
.NET Core, ASP.NET Core Course, Session 8
 
SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3
 
Hibernate
HibernateHibernate
Hibernate
 
Leverage Hibernate and Spring Features Together
Leverage Hibernate and Spring Features TogetherLeverage Hibernate and Spring Features Together
Leverage Hibernate and Spring Features Together
 
.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13
 
Hibernate notes
Hibernate notesHibernate notes
Hibernate notes
 
Plsql
PlsqlPlsql
Plsql
 
Web Application Deployment
Web Application DeploymentWeb Application Deployment
Web Application Deployment
 
R12 d49656 gc10-apps dba 10
R12 d49656 gc10-apps dba 10R12 d49656 gc10-apps dba 10
R12 d49656 gc10-apps dba 10
 
Formats
FormatsFormats
Formats
 
Unit5 servlets
Unit5 servletsUnit5 servlets
Unit5 servlets
 
Athena java dev guide
Athena java dev guideAthena java dev guide
Athena java dev guide
 
Jsp standard tag_library
Jsp standard tag_libraryJsp standard tag_library
Jsp standard tag_library
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySql
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3
 
Spring design-juergen-qcon
Spring design-juergen-qconSpring design-juergen-qcon
Spring design-juergen-qcon
 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
 
24 collections framework interview questions
24 collections framework interview questions24 collections framework interview questions
24 collections framework interview questions
 

Similar a Spring Framework Multiple Choice and Descriptive Questions

Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892Tuna Tore
 
SCWCD : The servlet container : CHAP : 4
SCWCD : The servlet container : CHAP : 4SCWCD : The servlet container : CHAP : 4
SCWCD : The servlet container : CHAP : 4Ben Abdallah Helmi
 
Tuning and optimizing webcenter spaces application white paper
Tuning and optimizing webcenter spaces application white paperTuning and optimizing webcenter spaces application white paper
Tuning and optimizing webcenter spaces application white paperVinay Kumar
 
Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2javatrainingonline
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCJohn Lewis
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depthVinay Kumar
 
quickguide-einnovator-7-spring-mvc
quickguide-einnovator-7-spring-mvcquickguide-einnovator-7-spring-mvc
quickguide-einnovator-7-spring-mvcjorgesimao71
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Michał Orman
 
Spring 3.1: a Walking Tour
Spring 3.1: a Walking TourSpring 3.1: a Walking Tour
Spring 3.1: a Walking TourJoshua Long
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and ODataAnil Allewar
 
SpringBootCompleteBootcamp.pptx
SpringBootCompleteBootcamp.pptxSpringBootCompleteBootcamp.pptx
SpringBootCompleteBootcamp.pptxSUFYAN SATTAR
 
Bt0083 server side programing
Bt0083 server side programing Bt0083 server side programing
Bt0083 server side programing Techglyphs
 
Spring from a to Z
Spring from  a to ZSpring from  a to Z
Spring from a to Zsang nguyen
 
Spring training
Spring trainingSpring training
Spring trainingTechFerry
 

Similar a Spring Framework Multiple Choice and Descriptive Questions (20)

Sel study notes
Sel study notesSel study notes
Sel study notes
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892
 
SCWCD : The servlet container : CHAP : 4
SCWCD : The servlet container : CHAP : 4SCWCD : The servlet container : CHAP : 4
SCWCD : The servlet container : CHAP : 4
 
Tuning and optimizing webcenter spaces application white paper
Tuning and optimizing webcenter spaces application white paperTuning and optimizing webcenter spaces application white paper
Tuning and optimizing webcenter spaces application white paper
 
Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2
 
Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVC
 
JEE5 New Features
JEE5 New FeaturesJEE5 New Features
JEE5 New Features
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depth
 
quickguide-einnovator-7-spring-mvc
quickguide-einnovator-7-spring-mvcquickguide-einnovator-7-spring-mvc
quickguide-einnovator-7-spring-mvc
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1
 
Spring 3.1: a Walking Tour
Spring 3.1: a Walking TourSpring 3.1: a Walking Tour
Spring 3.1: a Walking Tour
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
SpringBootCompleteBootcamp.pptx
SpringBootCompleteBootcamp.pptxSpringBootCompleteBootcamp.pptx
SpringBootCompleteBootcamp.pptx
 
Bt0083 server side programing
Bt0083 server side programing Bt0083 server side programing
Bt0083 server side programing
 
Spring from a to Z
Spring from  a to ZSpring from  a to Z
Spring from a to Z
 
Spring WebApplication development
Spring WebApplication developmentSpring WebApplication development
Spring WebApplication development
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring training
Spring trainingSpring training
Spring training
 

Más de than sare

Project Management_Review_2018
Project Management_Review_2018Project Management_Review_2018
Project Management_Review_2018than sare
 
Android review_for final Semester II of Year4
Android review_for final Semester II of Year4Android review_for final Semester II of Year4
Android review_for final Semester II of Year4than sare
 
Importain questions e_commerce_preview questions
Importain questions e_commerce_preview questionsImportain questions e_commerce_preview questions
Importain questions e_commerce_preview questionsthan sare
 
E commerce preview questions23 jul-2018
E commerce preview questions23 jul-2018E commerce preview questions23 jul-2018
E commerce preview questions23 jul-2018than sare
 
Physic grade-12
Physic grade-12Physic grade-12
Physic grade-12than sare
 
Business plan
Business planBusiness plan
Business planthan sare
 
Share point answer the question
Share point answer the questionShare point answer the question
Share point answer the questionthan sare
 
Judging rubric
Judging rubricJudging rubric
Judging rubricthan sare
 
Smartphone v ideo editing manual-ios(Tech By Ms.THAN Sare)
Smartphone v ideo  editing manual-ios(Tech By Ms.THAN Sare)Smartphone v ideo  editing manual-ios(Tech By Ms.THAN Sare)
Smartphone v ideo editing manual-ios(Tech By Ms.THAN Sare)than sare
 
Database(db sql) review
Database(db sql) reviewDatabase(db sql) review
Database(db sql) reviewthan sare
 
Answer ado.net pre-exam2018
Answer ado.net pre-exam2018Answer ado.net pre-exam2018
Answer ado.net pre-exam2018than sare
 
Review oop and ood
Review oop and oodReview oop and ood
Review oop and oodthan sare
 
Technovation week6 planning_yourcode
Technovation week6 planning_yourcodeTechnovation week6 planning_yourcode
Technovation week6 planning_yourcodethan sare
 
Sen sors(technovation) week6_thansare
Sen sors(technovation) week6_thansareSen sors(technovation) week6_thansare
Sen sors(technovation) week6_thansarethan sare
 
Week5(technovation)-Teach by Mr.than Sare
Week5(technovation)-Teach by Mr.than SareWeek5(technovation)-Teach by Mr.than Sare
Week5(technovation)-Teach by Mr.than Sarethan sare
 
App inventor week4(technovation)
App inventor week4(technovation)App inventor week4(technovation)
App inventor week4(technovation)than sare
 
Algorithm week2(technovation)
Algorithm week2(technovation)Algorithm week2(technovation)
Algorithm week2(technovation)than sare
 
Html training part1
Html training part1Html training part1
Html training part1than sare
 

Más de than sare (20)

Project Management_Review_2018
Project Management_Review_2018Project Management_Review_2018
Project Management_Review_2018
 
Android review_for final Semester II of Year4
Android review_for final Semester II of Year4Android review_for final Semester II of Year4
Android review_for final Semester II of Year4
 
Importain questions e_commerce_preview questions
Importain questions e_commerce_preview questionsImportain questions e_commerce_preview questions
Importain questions e_commerce_preview questions
 
E commerce preview questions23 jul-2018
E commerce preview questions23 jul-2018E commerce preview questions23 jul-2018
E commerce preview questions23 jul-2018
 
Physic 12-2
Physic 12-2Physic 12-2
Physic 12-2
 
Physic grade-12
Physic grade-12Physic grade-12
Physic grade-12
 
Business plan
Business planBusiness plan
Business plan
 
Share point answer the question
Share point answer the questionShare point answer the question
Share point answer the question
 
Judging rubric
Judging rubricJudging rubric
Judging rubric
 
Smartphone v ideo editing manual-ios(Tech By Ms.THAN Sare)
Smartphone v ideo  editing manual-ios(Tech By Ms.THAN Sare)Smartphone v ideo  editing manual-ios(Tech By Ms.THAN Sare)
Smartphone v ideo editing manual-ios(Tech By Ms.THAN Sare)
 
Database(db sql) review
Database(db sql) reviewDatabase(db sql) review
Database(db sql) review
 
Answer ado.net pre-exam2018
Answer ado.net pre-exam2018Answer ado.net pre-exam2018
Answer ado.net pre-exam2018
 
Review oop and ood
Review oop and oodReview oop and ood
Review oop and ood
 
Technovation week6 planning_yourcode
Technovation week6 planning_yourcodeTechnovation week6 planning_yourcode
Technovation week6 planning_yourcode
 
Sen sors(technovation) week6_thansare
Sen sors(technovation) week6_thansareSen sors(technovation) week6_thansare
Sen sors(technovation) week6_thansare
 
Week5(technovation)-Teach by Mr.than Sare
Week5(technovation)-Teach by Mr.than SareWeek5(technovation)-Teach by Mr.than Sare
Week5(technovation)-Teach by Mr.than Sare
 
App inventor week4(technovation)
App inventor week4(technovation)App inventor week4(technovation)
App inventor week4(technovation)
 
Algorithm week2(technovation)
Algorithm week2(technovation)Algorithm week2(technovation)
Algorithm week2(technovation)
 
Sharepoint
SharepointSharepoint
Sharepoint
 
Html training part1
Html training part1Html training part1
Html training part1
 

Último

ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 

Último (20)

ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 

Spring Framework Multiple Choice and Descriptive Questions

  • 1. 1ចងក្រងដោយ: ថនសារិ រំលឹរដេដរៀនSpring Framworkក្រលងឆមាសដលើរទី២ឆ្ន ាំទី៤ររិញ្ញា រ័ក្រព័រមានវិទា I. Multiple Choice Question 1. Which are the modules of core container? A. Beans, Core, Context, SpEL B. Core, Context, ORM, Web C. Core, Context, Aspects, Test D. Bean, Core, Context, Test 2. What is a Singleton scope? A. The scopes the bean definition to a single instance per Spring loC container. B. The scopes the bean definition to a single instance per HTTP Request. C. The scopes the bean definition to a single instance per HTTP session. D. The scopes the bean definition to a single instance per HTTP application/Global session. 3. How to you turn on annotation wiring? A. Add<annotation-context:config/> to bean configuration B. Add<annotation-config/> to bean configuration C. Add<annotation-context-config/> to bean configuration D. Add<context:annotion-config/> to bean configuration 4. What is a Spring MVC framework? A. Spring MVC framework is a Model-Value-Class architecture and use to bind model data with values. B. The Spring web MVC framework provides model-view-controller architecture and ready component that can be used to develop flexible and loosely coupled web applications. C. Spring MVC framework is used for transaction management for web application. D. Spring MVC framework is used for APO for web application 5. What is ACID in transactional management? A. Accurate, Controlled, Isolation, Durability B. Atomicity, Consistency ,Independent, Done C. Atomicity, Consistency, Isolation, Durability D. Accurate, Controlled, Independent, Done 6. Can you inject null and empty String values to Spring? A. Yes 7. What is @Controller annotation? A. The @Controller annotation indicates that a particular class serves the role of controller. B. The @Controller annotation indicates how to control the transaction management. C. The @Controller annotation indicates how to control the dependency injection. D. The @Controller annotation indicates how to control the aspect Programming. 8. What is request scope? A. This scopes a bean definition to an HTTP request. B. This scopes the bean definition to Spring LoC container C. This scopes the bean definition to HTTP session D. This scopes the bean definition HTTP Application/ Global session
  • 2. 2ចងក្រងដោយ: ថនសារិ 9. Which of the following is correct about dependency injection? A. It helps in decoupling application object from each other. B. It helps in deciding the dependencies of objects. C. It store objects states in database. D. It store objects states in files system. 10. What AOP stands for? A. Aspect Oriented Programming B. Any Object Programming C. Asset Oriented Programming D. Asset Oriented Protocol
  • 3. 3ចងក្រងដោយ: ថនសារិ II. Answer the Question 1. What is Apache Maven and Gradle?  Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.  Gradle is an open-source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration. 2. What is Web.XML(Web deployment descriptor) use for in spring framework?  web.xml is a deployment descriptor file while using J2EE. ... Servlet to be accessible from a browser, then must tell the servlet container what servlets to deploy, and what URL's to map the servlets to. This is done in the web.xml file of your Java web application 3. What is <annotation-driven/> tag use for in spring configuration?  <annotation-driven> is used to detect the annotation like @Controller, @ResponseBody,…. 4. List of 3 type of ViewResolver in spring framework and their usage?  AbstractCachingViewResolver : Abstract view resolver that caches views. Often views need preparation before they can be used; extending this view resolver provides caching.  XmlViewResolver : Implementation of ViewResolver that accepts a configuration file written in XML with the same DTD as Spring’s XML bean factories. The default configuration file is /WEB-INF/views.xml.  ResourceBundleViewResolver : Implementation of ViewResolver that uses bean definitions in a ResourceBundle, specified by the bundle base name. Typically you define the bundle in a properties file, located in the classpath. The default file name is views.properties.  UrlBasedViewResolver : Simple implementation of the ViewResolver interface that effects the direct resolution of logical view names to URLs, without an explicit mapping definition. This is appropriate if your logical names match the names of your view resources in a straightforward manner, without the need for arbitrary mappings.  InternalResourceViewResolver : Convenient subclass of UrlBasedViewResolver that supports InternalResourceView (in effect, Servlets and JSPs) and subclasses such as JstlView and TilesView. You can specify the view class for all views generated by this resolver by using setViewClass(..).  VelocityViewResolver/FreeMarkerViewResolver : Convenient subclass of UrlBasedViewResolver that supports VelocityView (in effect, Velocity templates) or FreeMarkerView ,respectively, and custom subclasses of them.  ContentNegotiatingViewResolver : Implementation of the ViewResolver interface that resolves a view based on the request file name or Accept header.
  • 4. 4ចងក្រងដោយ: ថនសារិ 5. Describe annotation bellow with example: -@Controller @Controller is similar annotation which mark a class as request handler. package com.howtodoinjava.web; @Controller public class HomeController { @GetMapping("/") public String homeInit(Model model) { return "home"; } } -@Service @Service is a stereotype for the service layer. Package com.in28minutes.login inport org.springframwork.beans.factory.annotation.autowired; @Controller public class loginController{ @Autowired LoginService Service; @RequestMapping(value="/login",method=RequestMethod.GET) public String showLoginPage(){ return "login"; } } -@Repository @Repository is a stereotype for persistence layer. package com.spring.anno; @Service public class TestBean { public void m1() { //business code } } package com.spring.anno; @Repository public class TestBean { public void update() { //persistence code }
  • 5. 5ចងក្រងដោយ: ថនសារិ } -@Rest Controller @Rest Controller which is a convenience annotation that does nothing more than add the @Controller and @ResponseBody annotations. @Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Controller @ResponseBody public @interface RestController -@Request Mapping @RequestMapping is one of the most common annotation used in Spring Web applications. This annotation maps HTTP requests to handler methods of MVC and REST controllers. @RequestMapping(value = "/ex/foos", method = RequestMethod.GET) @ResponseBody public String getFoosBySimplePath() { return "Get some Foos"; } -@Path Variable @PathVariableannotation used to get variable name and its value at controller end. e.g. @RequestMapping(value = "/ex/foos/{fooid}/bar/{barid}", method = GET) @ResponseBody public String getFoosBySimplePathWithPathVariables (@PathVariable long fooid, @PathVariable long barid) { return "Get a specific Bar with id=" + barid + " from a Foo with id=" + fooid; } -@RequestParam The @RequestParam annotation is used with @RequestMapping to bind a web request parameter to the parameter of the handler method. The @RequestParam annotation can be used with or without a value. The value specifies the request param that needs to be mapped to the handler method parameter, as shown in this code snippet. The default value of the @RequestParam is used to provide a default value when the request param is not provided or is empty. @RestController @RequestMapping("/home") public class IndexController { @RequestMapping(value = "/fetch", params = {"personId=10"})
  • 6. 6ចងក្រងដោយ: ថនសារិ String getParams(@RequestParam("personId") String id){ return "Fetched parameter using params attribute = "+id; } @RequestMapping(value = "/fetch", params = {"personId=20"}) String getParamsDifferent(@RequestParam("personId") String id){ return "Fetched parameter using params attribute = "+id; } } -@Model Attribute @ModelAttribute is an annotation that binds a method parameter or method return value to a named model attribute and then exposes it to a web view. @ModelAttribute("person") public Person getPerson(){ return new Person(); } -@Request Header @RequestHeader that can be used to map controller parameter to request header value @Controller public class HelloController { @RequestMapping(value = "/hello.htm") public String hello(@RequestHeader(value="User-Agent") String userAgent) //.. } } -@Request Body @Request Body is Annotation indicating a method parameter should be bound to the body of the HTTP request. @RequestMapping(path = "/something",method = RequestMethod.PUT) public void handle(@RequestBody String body, Writer writer) throws IOException { writer.write(body); } -@Response Body The @ResponseBody annotation can be put on a method and indicates that the return type should be written straight to the HTTP response body (and not placed in a Model, or interpreted as a view name). @RequestMapping(path = "/something",method = RequestMethod.PUT)
  • 7. 7ចងក្រងដោយ: ថនសារិ public @ResponseBody String helloWorld() { return "Hello World"; }