Pact Consumer Driven Contracts

https://javier.gilpereda.com/microservices/implementing-springboot-restapi-using-pact-consumer-driven-contracts-bdd-and-cdc https://docs.pact.io/5-minute-getting-started-guide https://docs.pact.io/ https://martinfowler.com/articles/consumerDrivenContracts.html Example Repo: https://github.com/mattiasmgn/Pact-JVM-Example Links: https://github.com/DiUS/pact_broker-docker https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-consumer-junit https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-provider-junit https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-provider-maven

SEAM and SelectOneMenu example

In JSF, tag is used to render a dropdown box – HTML select element with “size=1” attribute. The following example will show how to select a City from list of Cities and save the Postal Code for a given user using SEAM . In the above code “userForm.postalCode” refers to model “UserForm” with property postalCode,Continue reading “SEAM and SelectOneMenu example”

10 Steps to configure a CRUD Web application using Spring,Hibernate, and JSP

Here are the basic steps (broad overview)  to create a CRUD (Create,Read,Update,Delete) Web application using Spring, Hibernate and a DB Provider such as MySql.  I’ll make another future post to outline the details.   1. Using Eclipse  (Juno is the latest as of this post), setup a Dynamic Web Project and convert it to mavenContinue reading “10 Steps to configure a CRUD Web application using Spring,Hibernate, and JSP”

jQuery.hide( ) issue.

I have discovered a small issue in the jQuery hide() and show() methods, doing a $j(#ID_ELEM).hide() will append a  <span style > attribute causing possibly layout changes on the element you are trying to transform.  This is because the jQuery hide() and show() methods “animate the width, height, and opacity of the matched elements simultaneously” so as the height andContinue reading “jQuery.hide( ) issue.”

Hibernate Saving Collections (using @ElementCollection)

In this example you will learn how to deal with persisting entities that have members that are collections like lists, and maps. We will use the @ElementCollection annotation. to define the collection of Embeddable objects. As a disclaimer, this is not a typical usage of Embeddable objects as the objects are not embedded in theContinue reading “Hibernate Saving Collections (using @ElementCollection)”

Why do you get a ConcurrentModificationException when using an iterator?

The reason why you would get a ConcurrentModificationException The java.util Collection classes are fail-fast, which means that if one thread changes a collection while another thread is traversing it through with an iterator the iterator.hasNext() or iterator.next() call will throw ConcurrentModificationException . Even the synchronized collection wrapper classes SynchronizedMap and SynchronizedList are only conditionally thread-safe,Continue reading “Why do you get a ConcurrentModificationException when using an iterator?”

Integrating jQuery into an existing SEAM project

If you require jQuery in a Java SEAM project (or a web application using JSF or Struts but embedding Richfaces in it), you’ll need to redefine jQuery’s $() shortcut to avoid conflict with prototype.js which is widely used in Richfaces framework Luckily you can use a4j’s loadScript function since as of Richfaces 3.0, jQuery hasContinue reading “Integrating jQuery into an existing SEAM project”

Tips and Pitfuls for overriding equals method in Java

If you’re a java developer, you already know Class java.lang.Object defines an equals method, which subclasses may override. Here are some tips and pitfuls in implementing equals in this quick blog entry.  But before we diverge into some pointers, let’s review the rules to override the equals method Java. As per following rule equals method in Java should be: 1) Reflexive : ObjectContinue reading “Tips and Pitfuls for overriding equals method in Java”

Hibernate One-To-Many Mapping Tutorial

In this example you will learn how to map one-to-many relationship using Hibernate. Consider the following relationship between Student and Phone entity. According to the relationship a student can have any number of phone numbers. The relational model is shown below. To create this relationship you need to have a STUDENT, PHONE and STUDENT_PHONE table.  ToContinue reading “Hibernate One-To-Many Mapping Tutorial”