Spring Programming Flashcards
Do you need to define any dependencies in order to use beans from one extension in the other extension?
If yes, where?
- There is no need to define any dependencies
- All beans can be accessed with or without defining dependencies
- Extensioninfo.xml
- Localextensions.xml
- Extensioninfo.xml
- Localextensions.xml
What is the default bean scope if bean scope is not defined?
- session
- request
- tenant
- singleton
singleton
How the GenericApplicationContext is constructed and when is it loaded?
- Is constructed using all configuration files of all the extensions by start-up time and is loaded during hybris startup
- Is constructed using configuration files of the platform core extensions by start-up time and is loaded when you run a hybris build
- Is constructed using all configuration files of all the extensions by start-up time and is loaded when you run a hybris build
- Is constructed using configuration files of the platform core extensions by start-up time and is loaded during hybris startup
Is constructed using all configuration files of all the extensions by start-up time and is loaded during hybris startup
Which of the following listeners will allow beans defined within Web Application Context to refer the beans available in Global Application context?
- org.springframework.wecontext.ContextLoaderListener
- org.springframework.wecontext.request.RequestContextListener
- de.hybris.platform.spring.HybrisContextLoaderListener
- none of the above
de.hybris.platform.spring.HybrisContextLoaderListener
Which of the following is not a valid type of Advice?
- Around advice
- After advice
- After throwing advice
- Before throwing advice
Before throwing advice
Which of the following are common and important Application Context implementations?
- ClassPathXmlApplicationContext
- FileSystemXmlApplicationContext
- XmlWebApplicationContext
- HybrisApplicationContext
ClassPathXmlApplicationContext
FileSystemXmlApplicationContext
XmlWebApplicationContext
Which of the following are two important bean lifecycle methods?
- setup and teardown
- init and destroy
- create and destroy
- setup and destroy
setup and teardown
Which of the following bean scopes are valid only in the context of a web-aware Spring ApplicationContext?
- tenant
- prototype
- yrequest
- request
request
Which of the following variable resolver lets you use Spring with JSF?
- org.springframework.wejsf.DelegatingVariableResolver
- org.springframework.weDelegatingVariableResolver
- Spring cannot be used with JSF
- none of the above
org.springframework.wejsf.DelegatingVariableResolver
Which of the following Spring Security concepts are relevant to Hybris?
- Authentication Provider
- Access Decision Voter
- Password Callback
- All of the above
All of the above
Choose which is true:
- Central to the Spring Framework is its IOC container
- IOC provides a consistent means of configuring and managing Java objects using call-backs.
- IOC container is responsible for managing object lifecycles
- The object life cycle used for creates objects, call initialization methods, and configure objects by wiring them together.
- All of above
- None
All of above
What is the Type of Proxy in Spring Framework?
- Static
- Dynamic
- Response
- None
Dynamic
How could you externalize constants from a Spring configuration file or a Spring annotation into a .properties file ? Select one or more answers
- By using the <constant></constant> tag
- By declaring the ConstantPlaceholderConfigurer bean post processor
- By using the <property-placeholder></property-placeholder> tag
- By using the c: namespace
By using the <property-placeholder></property-placeholder> tag
What statements are not correct? Select a unique answer.
- Constuctor and properties autowiring in the same bean are not compatible
- A bean should have a default or a no-args constructor
- The <constructor-arg> tag could take type, name and index to reduce ambiguity</constructor-arg>
- None of the above
- All of the above
All of the above
What could not return a Spring MVC controller? Select a single answer.
- An absolute path to the view
- A logical view name
- A new JstlView
- void
An absolute path to the view
Where do you cannot declare Spring MVC controller? Select one or more answers.
- In a Spring application context XML configuration file
- Into the wexml file of the web application
- Into the java code by using annotations
- Into the JSP pages
- Into the wexml file of the web application
- Into the JSP pages
How could you secure MVC controller with Spring Security? Select a unique answer.
- With the @Secured annotation
- With the @RolesAllowed annotation
- In a XML security configuration file
- All of the above
- None of the above
All of the above
What are the possible mechanisms provided by Spring Security to store user details? Select one or more correct answers.
- Database
- JAAS
- LDAP
- Properties file
- Database
- JAAS
- LDAP
- Properties file
What is true about Spring security configuration and the security namespace? Select one or more correct answers
- The access attribute of the intercept-url tag support both EL and constants together.
- The patterns declared into the intercept-url tag are analyzed from up to bottom. Winning is the first that matches
- The patterns declared into the intercept-url tag use by default the java regex syntax.
- Security rules may applied depending request parameter
The patterns declared into the intercept-url tag are analyzed from up to bottom. Winning is the first that matches
Spring MVC is a request-based framework.
- Yes
- No
Yes
Spring’s Transaction management feature can fully replace all the features of EJB’s Container managed transaction
- Yes except the global transactions
- FALSE
- True , no exceptions
Yes except the global transactions
What do you understand by Inversion of Control(IO
- The object define their dependencies and the container injects the dependencies when it creates the bean
- A property available in the Spring Framework in which caller methods control the creation of parent
- Inversion of Control (Io is an object-oriented programming practice where the object coupling is bound at run time by an assembler object and is typically not known at compile time using static analysis
- The object define their dependencies and the container injects the dependencies when it creates the bean
- Inversion of Control (Io is an object-oriented programming practice where the object coupling is bound at run time by an assembler object and is typically not known at compile time using static analysis
What are the types of injection supported by Spring ?
Constructor Injection only
Constructor Injection and Setter Injection
Constructor Injection , Setter Injection and Interface Injection
Constructor Injection and Setter Injection
Can you instantiate a static inner class in spring
No. Static classes are not supported
Yes. They are instantiated by default with the class
Yes. But you will have to use the binary name of the class
Yes. But you will have to use the binary name of the class
b
c
Both a and b are correct"
extensioninfo.xml
buildcallbacks.xml
wexml"
For each servlet configuration using a derive of the DispatcherServlet, an own application context is created, whereas the root web application context is set as parent.
if you have configured your root web application context using
the HybrisContextLoaderListener you are also able to access beans of the global ApplicationContext"
None of the above"
none of above"
Customisation of the username and authority is possible in the
Configuring the
None of the above"
Both
none "