What is the delegating filter proxy in Spring Security? How it works?
Java Revisited
by javin paul
2d ago
The Delegating filter proxy or DelegatingFilterProxy is a spring aware class which implements javax.servlet.Filter interface and used to activate Spring security in a web application. Since Filters are created and maintained by Servlet or Web Container this filter is declared in web.xml and it is configured to process request for all URLs, which means every request and response pass through this filter. In other words, DelegatingFilterProxy works as a proxy between Web Container and Spring Container. It passes all request and response to Spring Security to implement security constraints e.g. p ..read more
Visit website
How to get the selected radio button on click using jQuery? Example Tutorial
Java Revisited
by javin paul
6d ago
In last couple of articles, you have learned how to get all checked checkbox and how to find the unchecked checkbox using jQuery, let's see another similar example, this time with radio button. Suppose, in form you have two radio buttons to select the gender i.e. male and female. How do you find which radio button was selected when user clicked on them? well, we will use the jQuery selector to find that. In fact, its not much different than what you have used to find the checked checkbox i.e. $("input[type=radio]:checked") will give the selected radio button. In order to find the chosen radio ..read more
Visit website
What is WeakHashMap in Java? When to use it? Example Tutorial
Java Revisited
by javin paul
1w ago
WeakHashMap is an implementation of Map interface in Java. It's a special Map where entries can be reclaimed by Garbage collector if there is no more strong reference exists to the value, apart from the key in the WeakHashMap, which is anyway the weak reference. This property allows a WeakHashMap to be used as Cache, where Garbage Collector can automatically cleanup dead entries. I mean those objects which are only alive inside map but there is no outside entries. Worth noting is that the key are stored as WeakReferences inside WeakHashMap which allows values to be reclaimed if there is no str ..read more
Visit website
17 SQL Query Best Practices Every Developer Should Learn
Java Revisited
by javin paul
1w ago
Hello guys, its no secret that SQL is one of the must have skill in this data driven world and its also one of those skills which is equally useful for programmers, developers, database admins, data scientists, data analyst, business analyst, quality analyst and even project managers. I first learned SQL 20 years back when I was in college and that time we are using Oracle database. I still remember my first query about "SELECT * FROM EMP",  EMP was one of the tables which was quite popular among learners and most of the Oracle DB instance on labs have that.  Java, Unix, Tibco RV an ..read more
Visit website
How to create 2 dimensional Array in Java? Example Tutorial
Java Revisited
by javin paul
2w ago
There are many ways you can declare a two-dimensional integer array in Java. Since 2D array in Java is nothing but an array of array, you can even declare array with just one dimension, the first one; second dimension is optional. You can even declare a 2 dimensional array where each sub array has different lengths. You can also initialize the array at the time of declaration or on some later time by using nested for loop. So there is lots of flexibility. In this article, you will learn common Java idioms to declare and initialize two dimensional arrays with different lengths.  Java, Uni ..read more
Visit website
What is lazy loading in Hibernate? Lazy vs Eager loading Example
Java Revisited
by javin paul
2w ago
Lazy loading in Hibernate is a feature which allows Hibernate to load the dependent objects lazily to improve performance of Java application. By default Hibernate does eager or aggressive loading for single valued associations (many to one and one-to-one ) and lazy loading for collection-valued associations (one to many or many-to-many). If you set the loading to lazy=false or FetchType.EAGER then object will be eagerly loader, means when an object is loaded from database all its relationship and associated objects are also loaded from Database e.g. when an Author entity object is i ..read more
Visit website
Difference between @Secured vs @RolesAllowed vs @PreAuthorize, @PostAuthorize Annotations in Spring Security
Java Revisited
by javin paul
2w ago
Spring Security is a powerful framework to implement security on Spring based Java web application as well as on security RESTful Web Services. It also provides method level security, which means restricting access to a method depending upon role and permissions of object. If a user calling the method has access the method will be executed, otherwise AccessDeniedException will be thrown by Spring Security. All these annotations e.g. @Secured, @RolesAllowed, @PreAuthorize, and @PostAuthorize is used to implement method level security in Spring security, but there are some subtle difference betw ..read more
Visit website
How to Create a TCP Client and Server in Java? Example Tutorial
Java Revisited
by javin paul
1M ago
Hello guys, if you want to create client server application in Java then you need to learn Java networking API an classes like Socket and ServerSocket. In the past, I have showed you how to create an HTTP Client and Server in Java where I talked about these classes. In this Java networking tutorial, we will learn how to create a simple TCP server and Client in Java using networking classes provided by JDK in java.net package. Earlier, I have showed you how to create HTTP Server, which is actually a TCP/IP Server but here we'll do it again, along with writing a TCP client as well. Though you ca ..read more
Visit website
How to find smallest number from int array in Java, Python, JavaScript and Golang? [Solved]
Java Revisited
by javin paul
1M ago
This is the second part on this array interview question. In the first part, I have showed you how to find the largest element in array, and in this part, you will learn how to find the smallest number from an integer array. We will solve this problem on Java programming language but you are free to solve in any other programming language like Python or JavaScript. Most interviewer doesn't care much about which programming language you are solving the question, if you can provide working solution. This one is also a popular Java programming exercise which is taught in school and colleges and g ..read more
Visit website
Top 15 NetBeans Keyboard Shortcuts for Java Programmers
Java Revisited
by javin paul
1M ago
In Java development there are three big IDEs, IntelliJ IDEA, Eclipse and NetBeans. In the past, I have shared Eclipse keyboard shortcuts and IntelliJ IDEA courses and today, I am going to share keyboard shortcuts for NetBeans, one of the first Java IDE I used in my career. I started doing Java development when JCreator was considered great because it can help with function names on objects but when NetBeans comes with features like built-in Tomcat and built-in profiler, it changed the game and I extensively used NetBeans for both web and mobile application development with J2ME. Since then a l ..read more
Visit website

Follow Java Revisited on FeedSpot

Continue with Google
Continue with Apple
OR