logo
  • Home
  • Test & Rank
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Mining
  • Marine
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Jobs
  • Contact

Java-Spring Multiple Choice Questions | MCQs | Quiz

Spring Interview Questions and Answers
Practice Spring questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

•   Beans Creation
•   Beans Declaration
•   Beans Scopes
•   Beans Post Processors
•   Spring Task Executors
•   AspectJ Annotation
•   Pointcut Definitions
•   Beans Behaviour
•   AspectJ Aspects
•   Beans Implementation
•   Beans Scripts
•   Securing URL Access
•   Securing Web Applications
•   Handling Views Security
•   Spring Frameworks
•   Web Flows Management
•   Web Flows Security
•   JSF Spring Web Flow
•   Spring MVC Applications
•   User Locales Messages
•   Views Mapping & Handling
•   Bean Validation
•   Spring REST Service
•   JSON REST
•   Spring Flex & Sandbox
•   Spring Blaze DS Support
•   Grails Application & Plugins
•   Application Domain Classes
•   I18n Storage Properties
•   Logging & Unit Testing
•   Custom Layouts & Tags
•   Spring Roo
•   Spring Source Tool Suite
•   Unit Testing
•   Integration Testing
•   Spring MVC Portlet
•   Direct JDBC Problems
•   JDBC Template
•   Handling Exceptions
•   ORM Frameworks
•   Hibernate & JPA
•   Transaction Management
•   Transaction Attribute
•   Spring EJB 2.x
•   Spring EJB 3.0
•   SOAP Web Services
•   Spring Web Services
•   XML Marshalling & Services
•   JMX MBeans
•   E-mail & Scheduling
•   JMS Transactions
•   Spring Connections
•   Systems Integration
•   Error handling
•   Splitters & Aggregators
•   Spring Batch & Gateways
•   Spring Batch Infrastructure
•   Transactions & Retry
•   Controlling Step Execution
•   Clustering Object State
•   Load Balancing
•   Workflow Models & JBPM
•   Integrating JBPM 4
•   Spring Business Process
•   OSGI Basics
•   Spring Dynamic Modules
•   Spring Source DM Server
•   Java Serialization
•   Java Email APIs

Spring Tests

Certification Test
Internship Test
Job Test
All Tests
Top Rankers
Practice Test 1
Practice Test 2
Practice Test 3
Practice Test 4
Practice Test 5
Practice Test 6
Practice Test 7
Practice Test 8
Practice Test 9
Practice Test 10
Mock Test 1
Mock Test 2
Mock Test 3
Mock Test 4
Mock Test 5
Mock Test 6
Mock Test 7
Mock Test 8
Mock Test 9
Mock Test 10
« Prev Page
Next Page »

Spring Questions and Answers – User Locales and Locale-Sensitive Text Messages

Posted on June 12, 2017 by Manish

“This set of Java Spring Interview Questions and Answers for freshers focuses on “User Locales and Locale-Sensitive Text Messages”.

1. Interface implemented by locale resolver.
a) localeResolver
b) tiles
c) front controller
d) none of the mentioned
View Answer

Answer: a
Explanation: In a Spring MVC application, a user’s locale is identified by a locale resolver, which has to implement the LocaleResolver interface.
advertisement

2. You can define a locale resolver by registering a bean of type LocaleResolver in the web application context.
a) True
b) False
View Answer

Answer: a
Explanation: You must set the bean name of the locale resolver to localeResolver for DispatcherServlet to auto-detect.

3. Default localeResolver used by Spring.
a) AcceptHeaderLocale
b) AcceptHeader
c) AcceptHeaderLocaleResolver
d) AcceptLocaleResolver
View Answer

Answer: c
Explanation: The default locale resolver used by Spring is AcceptHeaderLocaleResolver.

4. AcceptHeaderLocaleResolver esolves locales by inspecting the accept-language header of an HTTP request.
a) True
b) False
View Answer

Answer: a
Explanation: This header is set by a user’s web browser according to the locale setting of the underlying operating system.

5. Alternative way to resolve locales.
a) AcceptHeaderLocale
b) AcceptHeader
c) AcceptHeaderLocaleResolver
d) SessionLocaleResolver
View Answer

Answer: d
Explanation: Another option of resolving locales is by SessionLocaleResolver.

6. Property which indicates how many seconds this cookie should be persisted.
a) cookieMaxAge
b) cookieName
c) cookieAge
d) none of the mentioned
View Answer

Answer: a
Explanation: The cookieMaxAge property indicates how many seconds this cookie should be persisted.
advertisement

7. Method used to change user’s locale.
a) set
b) setLocale
c) locale
d) set_locale
View Answer

Answer: b
Explanation: Changing a user’s locale by calling LocaleResolver.setLocale() explicitly.

8. Property of LocaleChangeInterceptor used to customize parameter name.
a) localeResolver.setLocale
b) paramName
c) locale.parm
d) none of the mentioned
View Answer

Answer: b
Explanation: Changing a user’s locale by calling LocaleResolver.setLocale() explicitly.

9. LocaleChangeInterceptor can only detect the parameter for the handler mappings that enable it.
a) True
b) False
View Answer

Answer: a
Explanation: So, if you have more than one handler mapping configured in your web application context, you have to register this interceptor to allow users to change their locales in any of the URLs.

10. Parameter which can change user’s locale by any URL.
a) locale
b) languageURL
c) language
d) none of the mentioned
View Answer

Answer: c
Explanation: Now a user’s locale can be changed by any URLs with the language parameter.

11. Interface used to resolve text messages.
a) Message
b) Message_Source
c) Language
d) MessageSource
View Answer

Answer: d
Explanation: Spring is able to resolve text messages for you by using a message source, which has to implement the MessageSource interface.

12. Tag used by view to resolve text messages.
a) spring:message
b) spring:language
c) spring:title
d) none of the mentioned
View Answer

Answer: a
Explanation: Then your JSP files can use the spring:message tag, defined in Spring tag library, to resolve a message given the code.
advertisement

13. The ResourceBundleMessageSource implementation resolves messages for different locales.
a) True
b) False
View Answer

Answer: a
Explanation: The ResourceBundleMessageSource implementation resolves messages from different resource bundles for different locales.

14. cookieName is used by localeResolver to customize the cookie used.
a) True
b) False
View Answer

Answer: a
Explanation: The cookie used by this locale resolver can be customized by setting the cookieName and cookieMaxAge properties.

15. The cookieMaxAge value when browser is closed.
a) 0
b) 1
c) -1
d) true
View Answer

Answer: c
Explanation: The value -1 indicates that this cookie will be invalid after the browser is closed.

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

« Prev Page - Spring Questions and Answers – Spring MVC Web Applications and Requests handlers
» Next Page - Spring Questions and Answers – Views Mapping and Handling

« Chemical Process Calculation Questions and Answers – Temperature
Chemical Process Calculation Questions and Answers – Pressure and Hydrostatic Head-I »
advertisement

Deep Dive @ Sanfoundry:

  1. Java Programming Examples on Utility Classes
  2. C# Programming Examples on Networking
  3. C++ Questions and Answers
  4. Spring Questions and Answers
  5. Spring Questions and Answers – Spring MVC Web Applications and Requests handlers
  6. Spring Questions and Answers – Spring Batch and Gateways
  7. Spring Questions and Answers – Spring BlazeDS support
  8. Spring Questions and Answers – Splitters and Aggregators,Routing
  9. Spring Questions and Answers – Integrating Spring Web Flow with JSF
  10. What is Locale in C?
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and 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 & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
Terms
Privacy Policy
Jobs
Bangalore Training
Online Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry. All Rights Reserved.