When dealing with files in JavaScript, you may want to check whether or not a file is an image. This tutorial will show how to JavaScript check if file is image with pure JavaScript function...
Monthly Archive: February 2019
Jaxb marshal to String
When working with JAXB, sometimes you want a String representation of your XML. This tutorial will show how to JAXB marshal to String. Below the code of marshaling to String.
1 2 3 4 5 6 7 8 9 |
ClassWeWantToMarhsall cc = ...; JAXBContext context = JAXBContext.newInstance(ClassWeWantToMarhsall.class); Marshaller m = context.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); StringWriter sw = new StringWriter(); m.marshal(cc, sw); String result = sw.toString() |
Angular Spring Security CSRF configuration
CSRF (also known as XSRF) is a well known web security attack allowing hackers to steel your identity and perform requests on website where your are already logged into. This tutorial shows how to Angular...
Angular compress image before upload
In the previous tutorial, we discussed the file upload from a Angular Client to a Spring Boot back-end server. Most uploaded files on web are images. It’s always wise to compress and minify before...
Bootstrap Uncaught SyntaxError: Unexpected token export
You may encounter the following error when using Bootstrap popper with Angular : Bootstrap Uncaught SyntaxError: Unexpected token export Solution The problem is due to the Javascript import. Most certainly your imports looks like
1 2 |
"node_modules/jquery/dist/jquery.min.js", "node_modules/popper.js/dist/popper.min.js", |
You...
Angular file upload Spring Boot
This tutorial shows a step by step solution to Angular file upload Spring Boot backend and store it on file system. We will cover a file upload from a basic input and also from...
Angular download file with Spring Boot
This tutorial shows a step by step solution to Angular download file Spring Boot backend. We will cover the download of files located in system and others in classpath. Server side This section covers...
java: invalid source release: 8 on IntelliJ
When try to compile your Java code on IntelliJ, you may get the annoying java: invalid source release: 8 error. The complete error is as follows
1 2 3 4 |
Information:java: Errors occurred while compiling module Information:javac 7 was used to compile java sources Information:03/02/19 07:35 - Compilation completed with 1 error and 0 warnings in 1 s 529 ms Error:java: invalid source release: 8 |
The reason is that your project/module JDK...