Deploying To Tomcat using WAR files

When you deploy your Java web apps, you can make use of a Web Application Archive (WAR) file. The Web Application Archive (WAR) file is a compressed version of your web application. It uses the zip file format but the file has the .war extension. The best way to visualize it is think of your "webapp" directory being compressed as [...]

By |2020-12-26T06:56:23-05:00December 26, 2020|How-To, Java|Comments Off on Deploying To Tomcat using WAR files

Spring REST API: How to disable HTTP Delete/Put methods

Question I had a student ask the question:How can I disable HTTP Options/Delete/Put methods? At the application level it should support only GET and POST requests. Other request methods like put/delete need to be blocked. I am using Spring Boot, Spring MVC and Rest services. Answer One possible solution is to make use of Spring Interceptors. Spring Interceptors can intercept [...]

By |2020-01-06T14:14:38-05:00January 6, 2020|How-To, Spring|Comments Off on Spring REST API: How to disable HTTP Delete/Put methods

How To View Hibernate SQL Parameter Values

When using Hibernate, if you log the Hibernate SQL statements, you will see this: Hibernate: insert into student (email, first_name, last_name, id) values (?, ?, ?, ?) However, for debugging your application, you want to see the actual parameter values in the Hibernate logs. Basically, you want to get rid of the question marks in the Hibernate logs. You can [...]

By |2016-07-05T18:27:50-04:00July 5, 2016|Hibernate, How-To, Java|Comments Off on How To View Hibernate SQL Parameter Values

JDBC and MySQL: Getting rid of the dreaded message – WARN: Establishing SSL connection without server’s identity verification is not recommended

When connecting to a MySQL database, you may encounter this scary warning message. Thu Feb 04 14:49:25 IST 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate [...]

By |2016-05-20T20:34:58-04:00May 20, 2016|How-To, Java, JDBC, MySQL|Comments Off on JDBC and MySQL: Getting rid of the dreaded message – WARN: Establishing SSL connection without server’s identity verification is not recommended

JDBC BLOB: Handling large file sizes

JDBC has support for storing binary files in the database using the BLOB datatype. I covered this in a previous blog post: Reading and Writing BLOBs with MySQL. However, you may run into errors if you need to store large files. In particular, you may encounter the following error messages: Packets larger than max_allowed_packet are not allowed. Data too long [...]

By |2015-10-27T09:38:20-04:00October 27, 2015|How-To, Java, JDBC, MySQL|Comments Off on JDBC BLOB: Handling large file sizes

JSF: Setting itemLabel with selectItems

JSF provides UI components for drop-down lists. Drop-down lists are called selectOneMenu in JSF. When you use the components, you may have the requirement to use different values for the itemLabel and itemValue. You can accomplish this by making use of a Map collection (java.util.Map). The Map collection is a collection of key-value pairs. In JSF, you provide a reference [...]

By |2015-10-13T16:56:32-04:00October 13, 2015|How-To, JavaServer Faces (JSF)|Comments Off on JSF: Setting itemLabel with selectItems

JSF 2.2 Namespaces – JSF Tutorial

JSF 2.2 introduced a list of namespaces for the JSF components. In the list below, I show the old namespace along with the new one: Library Old URI New URI Composite Components http://java.sun.com/jsf/composite http://xmlns.jcp.org/jsf/composite Faces Core http://java.sun.com/jsf/core http://xmlns.jcp.org/jsf/core HTML http://java.sun.com/jsf/html http://xmlns.jcp.org/jsf/html JSTL Core http://java.sun.com/jsp/jstl/core http://xmlns.jcp.org/jsp/jstl/core JSTL Functions http://java.sun.com/jsp/jstl/functions http://xmlns.jcp.org/jsp/jstl/functions Facelets Templating http://java.sun.com/jsf/facelets http://xmlns.jcp.org/jsf/facelets Pass Through Attributes http://java.sun.com/jsf/passthrough http://xmlns.jcp.org/jsf/passthrough Pass Through [...]

By |2015-07-22T21:49:43-04:00July 22, 2015|How-To, Java, JavaServer Faces (JSF)|Comments Off on JSF 2.2 Namespaces – JSF Tutorial

How to Add Google Maps to Java Swing GUI

One of our readers recently had a question regarding Google Maps and Java Swing. He wanted to know how to use Google Maps inside of a Java Swing GUI application. There are a number of solution out there. In fact, StackOverflow has a good thread about the various solutions. There is also a commercial product that provides support for GoogleMaps. [...]

By |2015-05-15T10:24:54-04:00May 15, 2015|How-To, Java|2 Comments

Wrox #7: Java REST Web Services Tutorial Overview

In this video, I will give you an overview of the Java REST Web Services. Please SUBSCRIBE to my YouTube channel.   Follow luv2code with the links below: - Website: https://luv2code.com - YouTube: http://goo.gl/EV6Kwv - Twitter: http://goo.gl/ALMzLG - Facebook: http://goo.gl/8pDRdA --- Hey Everyone, You may have noticed that things were quiet around here. Well, a couple of months ago I [...]

By |2015-04-27T23:47:01-04:00April 27, 2015|How-To, Java, REST, Web Services|Comments Off on Wrox #7: Java REST Web Services Tutorial Overview
Go to Top