Browsed by
Category: Frameworks

Find all the Java/UI Frameworks.

Angular 6 access control using ngx-permission

Angular 6 access control using ngx-permission

Angular 6 access control using ngx-permission: We can’t see any enterprise applications without access control management as this is the most important feature which all the sites must have to avoid security violations and control the views for different user groups. In angular this can be easily achieved using ngx-permission, I personally used it in my application developments and did not face any issues so far, and even if you face any issues developer is so active to respond as…

Read More Read More

256 total views, no views today

How to disable the default spring security in spring boot ?

How to disable the default spring security in spring boot ?

How to disable the default spring security in spring boot ? To disable the spring boot’s default spring security / to disable the security for all the urls then include the below method in your custom security class which extends WebSecurityConfigurerAdapter Method to include: /* to permit all */ @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable().authorizeRequests().anyRequest().permitAll(); } Full class for reference:   @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) public class CustomJDSecurityConfig extends WebSecurityConfigurerAdapter { protected void…

Read More Read More

718 total views, no views today

Bean validation in Spring Rest using @Valid

Bean validation in Spring Rest using @Valid

Bean validation in Spring Rest using @Valid: Bean validation is important to validate the input bean received in the spring restful requestbody. And also default error messages may not be properly understandable by our consumers, so validating the bean and responding the proper readable message to our consumers makes our spring restful webservice better.   How are we going to do ?   1. Add the validation annotations to the bean fields(preferrably your Dto class), following are the supported annotations…

Read More Read More

373 total views, no views today

Entity to DTO using Model Mapper in Spring Restful Web services

Entity to DTO using Model Mapper in Spring Restful Web services

Entity to DTO using Model Mapper in Spring Restful Web services: In spring restful webservices we can not directly expose our entity pojo classes as json responses as it has lot of issues like security/unwanted data’s exposure etc. Data Transfer Object (DTO) is a design pattern which actually resolves this issue. I am going to do these sample in spring boot project. In highlevel idea behind this is, Create the DTO pojo classes for all/required of your Entities. 2. Write…

Read More Read More

385 total views, no views today

Difference between @Inject and @Autowired

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 of it effectively in real time use-cases. @Inject: Does not have ‘required’ attribute Throws exception if the dependency not found….

Read More Read More

427 total views, no views today

When does spring create instances to be injected ?

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 default, Application Context creates the instances of all the beans eagerly with singleton scope during it’s initialization process only. 292 total…

Read More Read More

292 total views, no views today

Reading ClassPath file in Spring Boot/Core Example

Reading ClassPath file in Spring Boot/Core Example

This below program reads the status.txt file from the classpath, that is src/main/resources in the maven projects using classpathloader in spring core/spring boot projects. Classpathloader converts it to inputstream, from inputstream we can convert to bufferedinputstream and read the file contents easily. File Structure: Here we have status.txt file inside the resources folder, and we have only the value 100 inside the txt file.   Scheduler in Spring Boot with 3 Simple Steps Example Mention the file name directly inside…

Read More Read More

491 total views, no views today

5 New Things you should know in Angular 5/6:

5 New Things you should know in Angular 5/6:

5 New Things you should know in Angular 5: Even though angular 5 announced as a major release, nothing affects the angular 4 applications and developers. Because majority of the things are modified behind the scenes (than HttpClient), we do not want to worry much about angular 5.     We knew angular 1 to angular 2 transformation, that is actually a major release, because the complete things needs to redesigned. Here things are not that bad, and my angular…

Read More Read More

496 total views, no views today

How to upgrade angular 4 to angular 5?

How to upgrade angular 4 to angular 5?

How to upgrade angular 4 to angular 5? In this article, we are going to see how to upgrade from angular 4 to angular 5.   Do remember, you will be able to see the angular core/http/common/router etc versions if you check only inside the angular projects. To Update Angular CLI:   The CLI can be updated by, Uninstalling old version -> npm uninstall -g @angular/cli And Installing the new one ->¬†npm install -g @angular/cli   If you update the…

Read More Read More

716 total views, no views today

Angular 4/5/6 CLI + Angular Universal Setup Steps

Angular 4/5/6 CLI + Angular Universal Setup Steps

Angular 4 CLI + Angular Universal Setup Steps: Angular universal is superb component for angular projects for server side rendering, which really resolves SEO related issues to the great extend. But setting up a angular universal will become little complex if you try after developing your complete applications. Because some of the component you used in your angular 4 project may not have a proper configuration to support angular universal.   So I highly recommend to run angular universal beginning…

Read More Read More

1,416 total views, no views today