Home » Tag Archives: XML (page 3)

Tag Archives: XML

Testing REST with multiple MIME types

spring-interview-questions-answers

1. Overview This article will focus on testing a RESTful Service with multiple Media Types/representations. This is the tenth of a series of articles about setting up a secure RESTful Web Service using Spring and Spring Security with Java based configuration.             The REST with Spring series: Part 1 – Bootstrapping a web application with ...

Read More »

JAXB – Representing Null and Empty Collections

java-interview-questions-answers

Demo Code The following demo code will be used for all the different versions of the Java model. It simply sets one collection to null, the second to an empty list, and the third to a populated list.             package package blog.xmlelementwrapper; import java.util.ArrayList; import javax.xml.bind.*; public class Demo { public static void main(String[] args) ...

Read More »

Don’t Use JSON And XML As Internal Transfer Formats http

json-logo

You have a system that has multiple components and they have to communicate. They do that either via internal web services or using a message queue. Normally, you would want to send (data transfer) objects from one component to another. Three typical examples: a user has registered and you send a message to a message queue and whenever the message ...

Read More »

Applying a Namespace During JAXB Unmarshal

java-logo

For some an XML schema is a strict set of rules for how the XML document must be structured. But for others it is a general guideline to indicate what the XML should look like. This means that sometimes people want to accept input that doesn’t conform to the XML schema for some reason. In this example I will demonstrate ...

Read More »

Android dynamic and XML layout

android-logo

Android activity contains various user interface components e.g Button, Radio button, List, Text field etc. The user interface component can be arranged/attached with the activity in two different ways. Declaring UI element in layoutfile Basically, Layout file is xml formatted file present in res/layout. In this file, tags are used to define any UI component and properties are used to ...

Read More »

Spring Profiles in XML Config Files

spring-interview-questions-answers

My last blog was very simple as it covered my painless upgrade from Spring 3.0.x to Spring 3.1.x and I finished by mentioning that you can upgrade your Spring schemas to 3.1 to allow you to take advantage of Spring’s newest features. In today’s blog, I’m going to cover one of the coolest of these features: Spring profiles. But, before ...

Read More »

Testing Spring & Hibernate Without XML

spring-interview-questions-answers

I’m very keen on the improvements in Spring 3 that eventually let you move away from XML into plain Java configuration with proper support from IDE and compiler. It doesn’t change the fact that Spring is a huge suite and it sometimes finding the thing you need can take a while. XML-free unit tests around Hibernate are one such thing. ...

Read More »

JAXB and Root Elements

java-interview-questions-answers

@XmlRootElement is an annotation that people are used to using with JAXB (JSR-222). It’s purpose is to uniquely associate a root element with a class. Since JAXB classes map to complex types, it is possible for a class to correspond to multiple root elements. In this case @XmlRootElement can not be used and people start getting a bit confused. In ...

Read More »

EclipseLink MOXy as a JAXB provider

eclipselink-logo

EclipseLink MOXy is a JAXB provider and is a compelling alternative to the default JAXB provider built into JDK. First a simple test to marshal a Java object to XML: This is the model: @XmlRootElement(name='MemberDetailsRequest', namespace='http://bk.org/memberservice/') @XmlAccessorType(XmlAccessType.FIELD) public class MemberDetailsRequest { public MemberDetailsRequest() { } public MemberDetailsRequest(Long id) { this.id = id; } private Long id; public Long getId() { ...

Read More »

RichText editor component for SWT based applications

java-duke-logo

This article will go through the task of implementing our own RichText editor component with SWT. I faced the need for such a visual component when developing a desktop based application for one of my customers and wanted to add a functionality to allow users to write rich text comments with bold, italic, strike through, etc. capabilities. At that moment ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close