Home Blog Page 2

Blog

What is the delegating filter proxy? Delegating filter proxy is a servlet filter registered with the web container that delegates the requests to a Filter implementation on the Spring context side. That is there a 2 places servlet filters are attached to:Web container  Spring contextAs of Spring Security all requests pass through delegating filter proxy that is registered with the container...

Hibernate notes

0
Hibernate is an ORM framework that implements Java Persistence API (JPA).For Hibernate to work we need 3 things:Hibernate configuration (hibernate.properties or hibernate.cfg.xml) Mapping metadata (XML or annotation-based) - info for instructing Hibernate on how the entities have to be mapped to DB tables. Mapping metadata contains persistence unit info. Persistence unit - per database mapping configuration + some other...
What is the difference between checked and unchecked exceptions? Checked exceptions are exceptions that are checked at compile time - that fact enforces the developer to either catch it and handle or declare as being thrown and it will be propagated in call stack. Unchecked exceptions are not checked at compile time. Why do we (in Spring) prefer unchecked exceptions? Spring prefers...
MVC is an abbreviation for a design pattern. What does it stand for and what is the idea behind it? MVC stands for Model-View-Controller. The idea is to separate these three concepts rather than mixing them - as it is very hard to work when you have a view mixed with a controller and you need to change some details of...
What is the concept of AOP? Which problem does it solve?Aspect Oriented Programming (alias AOP) is a concept of separating cross-cutting parts of an application. For example suppose you want to add logging or some security functions to different elements of your application. Usually you would add some code to each element you want to add that functionality to....

Fast Logback

0
I've been reading Logback documentation today and found an interesting moment about its speed of logging.Assuming we have set a logging level higher than DEBUG (INFO, WARN or ERROR) and then we try to log something like: Object someObject = new Object(); Logger log = LoggerFactory.getLogger("com.foo"); log.debug("Message about" + String.valueOf(object)); This approach takes long time to calculate because independent of the fact that...

The lost camel

0
There is something interesting about Camel Routes.Usually they are defined in the beginning and assumed to have the same endpoints. But today I had a situation when depending on the .process() execution the result endpoint had to be dynamic.So after consulting with one of my colleagues I found the following solution: public class CustomRoute extends RouteBuilder {...
Some background...In this series of posts I will give the answers I found for each of the Core Spring 4.2 Study Guide questions (you can download the guide at http://vojtechruzicka.com/wp-content/uploads/2016/10/Core-Spring-4.2-Certification-Study-Guide.pdf)Suppose you have 2 teams working on two different layers of the application: web and database. Well we use the Spring container for wiring these layers together.What is dependency injection and...
Servlets are programs that run on Web server (or Application server, which is usually called servelt container) and act as a middle layer between the web browser and database (or other application).Incoming (request)  Servlet Outgoing (response)Data from HTML forms, applets and custom HTTP clients Processes data and if required makes certain database requests etc. Response in form of HTML pages or explicit documents (Excel,...
Java Message Service (JMS) is vendor-agnostic Java API that one can use to integrate heterogeneous systems. This API is implemented by many vendors in their Message-Oriented Middleware (MOM) products, so when using any of these products (JMS providers) you can actually use the same API - the JMS API.JMS offers many advantages, main of them are:heterogeneous integration - some messaging systems allow...