Category: Java
Convert Polymorphic Object to XML using JAX-B
When you use polymorphism in your classes and you want to convert your object to XML using JAX-B, here is an example how to. Abstract Animal Class package com.memorynotfound.xml.jaxb; public abstract class Animal {...
Convert Java Object to XML specific order using JAX-B
Sometimes you want to generate an XML with elements in a specific order. With JAX-B this is very easy. Just annotate your class with the @XmlType annotation and add the property order using propOrder...
Convert XML to Object in Java using JAX-B
In the following tutorial we will show you how you can convert XML to Object in Java using JAX-B. Annotations Explained First we need to define our model that will be converted to XML...
Convert a Java Object to XML using JAXB
In the following tutorial we will show you how you can convert a Java Object to XML. Annotations Explained First we need to define our model that will be converted to XML representation. Here...
Configure HTTP/HTTPS Proxy Settings Java
For local networks inside an organisation it is common to access the public internet through a HTTP Proxy. This tutorial will show you how you can globally set the HTTP Proxy Settings in Java....
JAX-RS Rest Service Example with Jersey in Java
In this tutorial we will show you the basic configuration needed to get a RESTful web service up and running. Get the required dependencies, create and expose methods and finally configure the servlet to...
Produce and Consume JAX-WS SOAP Web Service example
JAX-WS is a Standard Java API for building web services and clients that communicate using XML. These communications could be message-oriented as well as Remote Procedure Call-oriented. These messages are transmitted as SOAP messages...
JSF Internationalisation i18n – Message bundles
In this tutorial we will show you how to support multiple languages using JSF Internationalisation. JSF internationalisation Project Structure src |–main | +–java | +–com | +–memorynotfound | |–LanguageSwitcher.java | +–resources | +–com |...
Calculate Relative Time also known as “Time Ago” In Java
Time Ago Generation Days, Hours, Seconds Here is an example of how you can calculate relative time also know as “time ago” in java. This will return the time difference between two dates in...