SlideShare a Scribd company logo
1 of 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";
}

More Related Content

What's hot

香港六合彩
香港六合彩香港六合彩
香港六合彩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
 

What's hot (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 to Spring review_for Semester II of Year 4

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 to Spring review_for Semester II of Year 4 (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 Question Part 2
Java J2EE Interview Question Part 2Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2
 
Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2Java J2EE Interview Questions Part 2
Java J2EE Interview Questions 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
 

More from 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
 

More from 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
 

Recently uploaded

Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 

Recently uploaded (20)

Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

Spring review_for Semester II of Year 4

  • 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"; }