Difference between @Inject and @Autowired

Difference between @Inject and @Autowired This is one of the important interview question of spring / spring boot framework interviews. Auto-wiring is the great feature we got to wire our application dependencies spring way, but it can be done by both JSR annotation and spring provided annotation. It is important to know the difference between these both to make use […]

88 total views, 9 views today

» Read more

When does spring create instances to be injected ?

When does spring create instances to be injected ? This is one of the famous spring / spring boot framework interview question. Spring creates the instances to be injected during the start up. If you have configured spring beans with lazy-init attribute then spring creates the instances of those bean only when you inject/any of it’s dependencies injects it. By […]

77 total views, 5 views today

» Read more

Why StringBuffer/StringBuilder should be avoided in HashMap?

Why StringBuffer/StringBuilder should be avoided in HashMap?   This is one of the core java interview question under collections category. Generally in all the map manipulations we use string and avoid stringbuffer and stringbuilders, because both are mutable. What is the issue if is mutable ? If you are keeping your hashmap’s key/value as stringbuilder/stringbuffer then once after you inserted […]

151 total views, 1 views today

» Read more

[Resolved] Spring boot JWT Filter called twice

[Resolved] Spring boot JWT Filter called twice: Recently when I was integrating JWT Filter and Simple CORS filter in my spring boot project, I observed that both the filters are called twice before actually reaching my servlet/rest controller.   After googling, I got this link, As per that, One invocation is by servlet container and the other is by Spring […]

106 total views, 1 views today

» Read more

org.springframework.web.HttpMediaTypeNotAcceptableException | Could not find acceptable representation

org.springframework.web.HttpMediaTypeNotAcceptableException | Could not find acceptable representation: Full Error details: {“timestamp”:1522250376646,”status”:406,”error”:”Not Acceptable”,”exception”:”org.springframework.web.HttpMediaTypeNotAcceptableException”,”message”:”Could not find acceptable representation”,”path”:”/category/deleteImage/google.png”}     As per this link, I found the solution for this issue:   Solution: @SpringBootApplication public class CouponzcornerBackendApplication { public static void main(String[] args) { SpringApplication.run(CouponzcornerBackendApplication.class, args); } @Configuration public static class PathMatchingConfigurationAdapter extends WebMvcConfigurerAdapter { @Override public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { configurer.favorPathExtension(false); […]

232 total views, 18 views today

» Read more

Difference between Component & Directive in Angular

Difference between Component & Directive in Angular: Component: Components can be created using @Component annotation. <app-header></app-header>, here app-header is the component. Components helps to split the application into smaller components. Only one component can be used per DOM element. <app-header app-footer></app-header app-footer> can’t do like this and all. Directive: Directive can be created using @Directive annotation. <button highLightMe>I log when […]

322 total views, 2 views today

» Read more

Difference between Structural and Attribute directives in angular?

What is the difference between Structural and Attribute directives ? Directives are divided into two types namely Structural and Attribute directives. These are the differences: Structural directives: It changes the structure of the DOM. * is prefixed to the structural directives. *ngIf, *ngFor are the examples of structural directives.   Attribute directives: It just changes the appearance of the DOM. […]

308 total views, 2 views today

» Read more

All about pipe in angular 5 for dummies (custom pipe | pure | impure pipes)

All about pipe in angular 5 for dummies (custom pipe | pure | impure pipes) We can create our custom pipes with the below steps: Create the typescript class with @Pipe decorator 2. Provide the name of the pipe to the @Pipe decorator’s name property. 3. Implement the class with PipeTransform 4. Provide the implementation of the pipe functionality inside […]

187 total views, 2 views today

» Read more

[Resolved] “org.springframework.web.HttpMediaTypeNotSupportedException” angular 5

Hi All,┬áRecently I came across this “org.springframework.web.HttpMediaTypeNotSupportedException” error while trying to hit my spring boot rest web services application from angular 5.   I am posting my experience because to help someone quickly. I almost cross checked all the places many times, but I could not find the below miss which I found at last and also do remember this […]

207 total views, no views today

» Read more

Generate angular + Java code using yeoman & Jhipster

Generate angular + Java code using yeoman & Jhipster Ensure you have installed yeoman (yo when dealing with npm and yarn) and jhipster (generator-jhipster when dealing with npm and yarn). If not installed, have a quick look at,     Step 1: Run yo jhipster     It will ask around 10 to 15 questions, you can provide the sample […]

276 total views, 2 views today

» Read more
1 2 3 64