18 Sep 2020

feedDZone Java Zone

Java Annotated Monthly – September 2020

September's here, and that means back to work, back to school. Or not. It feels like the world is applying a lot of wishful thinking and behaving as if everything is going back to normal. With so much uncertainty right now, it's a tempting approach for sure.

Anyway this is supposed to be about Java. This month we have another huge edition for you, and it includes the inevitable look at Java 15, a bunch of news about Java 16, articles and videos on testing, Java / Jakarta EE, and Java libraries.

18 Sep 2020 2:11pm GMT

17 Sep 2020

feedDZone Java Zone

Spring Boot + Jersey: Role-Based Security With JAX-RS Annotations

Need a better, easier way to manage authorization within your application? Check out this tutorial on role-based security with JAX-RS annotations. Let's get started!

17 Sep 2020 6:55pm GMT

Spring Boot - Building Restful Web Services With Jersey (XML) + JPA

In the video below, we take a closer look at how we can build production-ready services with Jersey, JPA, and Spring. Let's get started!

17 Sep 2020 6:31pm GMT

Spring Boot REST API Request Body Validation With Custom Validator

In the video below, we take a closer look at Spring Boot REST API Request Body Validation Example using Custom Validator. Let's get started!

17 Sep 2020 6:17pm GMT

Maven Plugin Testing In a Modern Way Part IV

In the previous part of the series - Maven Plugin Testing - In a Modern way - Part III we have seen how to define command line options. In this part, we will take a deeper look at which goals will run for each test case and how we can change that.

Let us start with simple example test case like the following:

17 Sep 2020 5:57pm GMT

Spring Boot REST API: PathVariable Validation Example

In the video below, we take a closer look at how we can perform PathVariable validation in a Spring Boot REST API. Let's get started!

17 Sep 2020 5:52pm GMT

16 Sep 2020

feedDZone Java Zone

Migrating SpringBoot PetClinic REST to Quarkus

In this post, I'm going to cover my experience migrating the Spring Boot PetClinic REST application to Quarkus, to check how hard it can be and also to see which are the metrics I obtain at the end.

This is only an experiment with an application with low complexity but touching several common libraries and concepts used by anyone that creates a Spring Boot application.

16 Sep 2020 7:57pm GMT

Spring Boot with Spring Data JPA [Book] | Spring Boot CRUD Example with RESTful APIs and JPA

In the video below, we take a closer look at Spring Boot With Spring Data JPA [Book] | Spring Boot CRUD Example with RESTful APIs and JPA. Let's get started!

16 Sep 2020 7:51pm GMT

Spring Boot REST Validation Example | Spring Boot REST API Request Body Validation Example

In the video below, we take a closer look at Spring Boot REST Validation Example | Spring Boot REST API Request Body Validation Example. Let's get started!

16 Sep 2020 7:41pm GMT

Spring Boot - Mapping/Error to a Custom Controller By Implementing ErrorController

In the video below, we take a closer look at Spring Boot - Mapping /error to a custom controller by implementing ErrorController. Let's get started!

16 Sep 2020 7:39pm GMT

The Less-Known API for Console Input in Java

These days with the presence of numerous GUI based and Web based apps, receiving input and data via console has reduced. However, there are applications that require and run in a console. Java applications are not an exception to this.

Getting input from the user was not as simple in Java as in other languages like scanf in C, cin in C++ and the input() method in Python. In the early days one had to write code like this

16 Sep 2020 7:39pm GMT

Spring Boot - Disabling Whitelabel Error Page

In the video below, we take a closer look at Spring Boot - Disabling Whitelabel error page. Let's get started!

16 Sep 2020 7:37pm GMT

Let's Talk About Implicit

use case A use case I hope from the above picture you can get an idea of "how an implicit can be useful". This is just a single use case and if you are more interested in knowing about Implicit then this blog is for you. In this blog, I am going to discuss Implicit in Scala. I hope this will be useful to you. So, let's talk about implicit

What Is Implicit?

The literal meaning of implicit is "Something that is suggested or implied". We can see it as something that is not directly or that someone understands themselves. In Scala also, the implicit has pretty much similar meaning. Before going into much detail, I'll take a simple example and explain how the compiler implements it.

Example

Error without Implicit

16 Sep 2020 4:44pm GMT

Introduction to MapStruct: An Easy and Fast Mapping at Compile Time

In a previous article, we learned about the proposal of DTO, the benefits and the issues about this new layer in our Java Application We can isolate the model from control in the MVC architecture perspective, although we add a new layer that implies more complexity, furthermore, there is a work of conversion between entity and DTO. In this tutorial, we'll explore one more tool the MapStruct.

MapStruct is a code generator that dramatically simplifies the mappings between Java bean types based on a convention over configuration approach. The generated mapping code uses explicit method invocations and thus is fast, type-safe, and easy to understand.

16 Sep 2020 2:53pm GMT

How to Obtain Auto-Generated Keys With Hibernate

Consider the following Author entity that delegates the keys generation to the database system:

Java
xxxxxxxxxx
1
10
1
@Entity public class Author implements Serializable { 
2
    
3
  @Id @GeneratedValue(strategy = GenerationType.IDENTITY) 
4
  private Long id; 
5
  
6
  private int age; 
7
  private String name; 
8
  private String genre; 
9
  ... 
10
}


Now, let's see how to retrieve the database auto-generated primary keys via getId(), JdbcTemplate and SimpleJdbcInsert.

16 Sep 2020 2:21pm GMT

How to Convert XLSX to PDF in Java

PDF documents are one of the most well-known and user-friendly formats for providing information to clients or associates. With its incredible versatility and compatibility, most platforms including PC, Mac, Linux, web browsers, and mobile platforms prefer this format for the sharing of locked documents and reports. Its convenience and maintenance of quality and fidelity make it the top choice for many organizations.

The option to convert to PDF or print a spreadsheet from within your application is invaluable for your clients and will remove the worry of corrupted formatting that make occur in directly saving an Excel file. Furthermore, when working with complex information such as the data input in Excel Spreadsheets, one accidental key stroke in an unlocked document could cause extensive damage and possibly hours of work to find and fix the mistake. This problem is easily solved, however, by sharing your completed document as a PDF rather than an open spreadsheet, as it removes the danger of accidental editing. To help solve these issues, the following Convert API will provide you with an easy way to convert your Excel documents into PDF using Java.

16 Sep 2020 1:30pm GMT

10 Nov 2011

feedPlanetJava

OSDir.com - Java: Red Hat's top secret Java Killer/Successor: The Ceylon Project

From the Ceylon dept.:

Gavin King of Red Hat/Hibernate/Seam fame recently unveiled the top secret project that he has been working on over the past two years, a new language and SDK designed to replace Java in the enterprise. The project came out of hiding without much fanfare or publicity at QCon Beijing in a keynote titled "The Ceylon Project - the next generation of Java language?".

10 Nov 2011 6:01am GMT

OSDir.com - Java: Oracle Introduces New Java Specification Requests to Evolve Java Community Process

From the Yet Another dept.:

To further its commitment to the Java Community Process (JCP), Oracle has submitted the first of two Java Specification Requests (JSRs) to update and revitalize the JCP.

10 Nov 2011 6:01am GMT

OSDir.com - Java: No copied Java code or weapons of mass destruction found in Android

From the Fact Checking dept.:

ZDNET: Sometimes the sheer wrongness of what is posted on the web leaves us speechless. Especially when it's picked up and repeated as gospel by otherwise reputable sites like Engadget. "Google copied Oracle's Java code, pasted in a new license, and shipped it," they reported this morning.



Sorry, but that just isn't true.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Java SE 7 Released

From the Grande dept.:

Oracle today announced the availability of Java Platform, Standard Edition 7 (Java SE 7), the first release of the Java platform under Oracle stewardship.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Java SE 7 Passes JCP

From the Jitters dept.:

The next edition of Java has been approved by a Java Community Process executive committee, but not without some acrimony.

10 Nov 2011 6:01am GMT

OSDir.com - Java: JDK 7 RC1 Released

From the JDK dept.:

After an initial round of testing we've declared build 147 to be the first Release Candidate of JDK 7.



There are only thirteen changes in this build. Over half of them are administrivial updates that don't affect the actual code; the remainder are true showstoppers, including several hard VM crashes and a JIT correctness bug identified by an Eclipse unit test.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Google Files Sizzling Answer to Oracle's Amended Java Complaint

From the Counter dept.:

Google has filed its answer to Oracle's amended complaint and its memorandum opposing Oracle's Motion to Dismiss. And we find out why Google didn't just roll over and pay Oracle for a license. Oracle asked in its motion to dismiss that the counterclaims alleging that Oracle's patents are invalid be dismissed. So Google explains more thoroughly why it believes they are in fact invalid. First, Google asserts:



Each of the Patents-in-Suit is invalid under 35 U.S.C. § 101 because one or more claims are directed to abstract ideas or other non-statutory subject matter.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache loses Java showdown vote to Oracle

From the Dis Harmony dept.:

The Apache Software Foundation - one of tech's most influential open-source groups - is closer to quitting Java's governing body after losing a stand-off vote against Oracle on Java.



The Reg has learned that with 75 per cent of qualifying Java Community Process (JCP) members having voted on whether to ratify Oracle's proposed roadmap for Java 7 and 8, Oracle's plan has been accepted.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache Software Foundation Resigns from Java Community Process

From the So Long dept.:

The Apache Software Foundation has resigned its seat on the Java SE/EE Executive Committee. Apache has served on the EC for the past 10 years, winning the JCP "Member of the Year" award 4 times, and recently was ratified for another term with support from 95% of the voting community. Further, the project communities of the ASF, home to Apache Tomcat, Ant, Xerces, Geronimo, Velocity and nearly a 100 mainstay java components have implemented countless JSRs and serve on and contribute to many of the JCPs technical expert groups.



We'd like to provide some explanation to the community as to why we're taking this significant step.



The recent Java SE 7 vote was the last chance for the JCP EC to demonstrate that the EC has any intent to defend the JCP as an open specification process, and demonstrate that the letter and spirit of the law matter. To sum up the issues at stake in the vote, we believe that while continuing to fail to uphold their responsibilities under the JSPA, Oracle provided the EC with a Java SE 7 specification request and license that are self-contradictory, severely restrict distribution of independent implementations of the spec, and most importantly, prohibit the distribution of independent open source implementations of the spec. Oracle has refused to answer any reasonable and responsible questions from the EC regarding these problems.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache Discontinues Independent Java Implementation 'Harmony'

From the DisHarmony dept.:

After the resignation of Apache from the Java SE/EE Executive Committee, the time has now come for Harmony to be added to the Apache Attic. Harmony was 'the project to produce an open source cleanroom implementation of Java.' An open vote was taken within the Project Management Committee, which resulted in a 20-2 majority to discontinue development.

10 Nov 2011 6:01am GMT

Javable: YourKit Java Profiler 7.0 released

The major update to YourKit Java Profiler has been released. Version 7.0 includes

10 Nov 2011 6:01am GMT

Javable: Sun phases out mobile Java

Sun will gradually phase out mobile Java (Java Micro Edition) and move respective services to Standard Edition. "We're trying to converge

10 Nov 2011 6:01am GMT

Javable: Google Android SDK is available

The development kit and API for Google mobile platform, Android, has been released.

10 Nov 2011 6:01am GMT

Javable: Consumer JRE Early Access

Sun has started an early access program to Java SE 6 Update N (formerly known as the "Consumer

10 Nov 2011 6:01am GMT

Javable: NetBeans 6.0 released

New version of pure Java IDE has been released, with support for many new

10 Nov 2011 6:01am GMT

Javable: Happy New Year!

We wish a Happy New Year to all our readers and contributers. Hope to see you all in 2008.

10 Nov 2011 6:01am GMT