Skip to main content

Posts

Showing posts with the label Spring BOOT

Spring Annotations

CREATING SIMPLE SPRING PROJECT[JAVA CONFIGURATION] STEP1 : ADD DEPENDENCIES groupId : org . springframework spring - core $ { spring . version } spring - webmvc < ! -- cglib required for @ configuration annotation -- > cglib : cglib \ STEP 2  : CREATE BEAN CLASS PROPERTY + CONSTRUTOR + GETTER /SETTERS   STEP 3  : CREATE CONFIGURTAION CLASS @ Configuration public class ApplicationConfiguration { @ Bean ( name = " countryObj " ) public Country getCountry ( ) {    return new Country ( "India" ) ; }    STEP 4  : CREATE MAIN CLASS public class SpringJavaConfigMain { public static void main ( String [ ] args ) { ApplicationContext appContext = new AnnotationConfigApplicationContext ( ApplicationConfiguration . class ) ;    Country countryObj = ( Country ) appContext . getBean ( " countryObj " ) ;    String c...