Home » Java (page 600)

Java

Drools Guvnor – Manage access

Externalize business or technical rules is very important for scalable applications but the BRMS service access should be managed. guvnor provides control UI access and operations using role based authorizations. There are several permissions types as listed in drools-guvnor reference manual. Admin with all permissions. Analyst or Analyst read-only: analyst permissions for a specific category. Package admin, Package developer or ...

Read More »

Using slf4j with logback tutorial

In current post I am going to show you how to configure your application to use slf4j and logback as logger solution. The Simple Logging Facade For Java (slf4j) is a simple facade for various logging frameworks, like JDK logging (java.util.logging), log4j, or logback. Even it contains a binding tat will delegate all logger operations to another well known logging ...

Read More »

Using Delayed queues in practice

Often there are use cases when you have some kind of work or job queue and there is a need not to handle each work item or job immediately but with some delay. For example, if user clicks a button which triggers some work to be done, and one second later user realizes he / she was mistaken and job ...

Read More »

What additional features does Java EE 6 have to move from Spring?

spring-interview-questions-answers

I am a senior java developer who has to work on the technologies chosen by the application architect. At the maximum I can express my opinion on a particular technology, I can’t make/influence technology selection decision. So I don’t have a choice of moving from Spring to JavaEE6 or from JavaEE6 to Spring on my official projects. I strongly believe ...

Read More »

Lazy JSF Primefaces Datatable Pagination – Part 2

The page code is very simple and there is no complication. Check the “index.xhtml” code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> <h:head> </h:head> <h:body> <f:view> <h:form> <p:dataTable id="lazyDataTable" value="#{playerMB.allPlayers}" var="player" paginator="true" rows="10" selection="#{playerMB.player}" selectionMode="single" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15" style="width: 80%;margin-left: 10%;margin-right: 10%;"> <p:ajax event="rowSelect" update=":playerDialogForm" oncomplete="playerDetails.show()" /> <p:column> ...

Read More »

Why Math.round(0.499999999999999917) rounds to 1 on Java 6

Overview There are two types of error representation error and arithmetic rounding error which are common in floating point calculations. These two error combine in this simple example, Math.round(0.499999999999999917) rounds to 1 in Java 6. Representation error Floating point is a base 2 format, which means all number are represented as a sum of powers of 2. e.g. 6.25 is ...

Read More »

Quartz scheduler plugins – hidden treasure

Although briefly described in the official documentation, I believe Quartz plugins aren’t known enough, looking at how useful they are. Essentially plugins in Quartz are convenient classes wrapping registration of underlying listeners. You are free to write your own plugins but we will focus on existing ones shipped with Quartz. LoggingTriggerHistoryPlugin First some background. Two main abstractions in Quartz are ...

Read More »

Lazy JSF Primefaces Datatable Pagination – Part 1

Today we will do JSF datatable pagination with a Lazy List with a view scoped managed bean. What all those words/expressions mean? There are several JSF frameworks today that provide datatables with a ready pagination, columns sorter and others functionalities. Today we will use the Primefaces datatable. Usually the datatables will put the displayed List, with the entities, inside the ...

Read More »

JAXB and Unmapped Properties

java-interview-questions-answers

JAXB (JSR-222) is configuration by exception, meaning that there is a default mapping applied to domain objects. This means that sometimes you need to explicitly exclude a field/property. In this post I’ll discuss how this can be done using @XmlTransient or @XmlAccessorType(XmlAccessType.NONE) and when each option is appropriate. @XmlTransient When you mark a field/property with @XmlTransient you are explicitly telling ...

Read More »