Articles, dummyCategory

Java platform module system cheat sheet | Rogue Wave

Java 9 has introduced modules to the Java platform, changing the way we build and design applications. If you need a refresher on Java 9 modules, look no further than our cheat sheet. It covers module-info.java file contents, Java command line options, manifest attributes, and module types.

Articles, dummyCategory

Spring Security 5 Java Config – @EnableWebSecurity Example

Java example to enable spring security java configuration with the help of @EnableWebSecurity annotation and WebSecurityConfigurerAdapter class. 1) Include spring security dependencies Include spring security jars. I am using maven so added respective dependencies for spring security 5. 2) Create Security Configuration I have created this simple security configuration and added two demo users ‘user‘ …

Articles, dummyCategory

Java Evaluate XPath on a XML String – HowToDoInJava

Java example to evaluate xpath of an XML String and return result XML in string itself. Evaluate XPath on XML String Create org.xml.sax.InputSource containing with StringReader referencing to XML string. Create XPath from XPathFactory. Use xpath.evaluate(‘expression’, inputSource) to get result HTML. Program output: Happy Learning !!

Articles, dummyCategory

Java Evaluate XPath on DOM Document Object – HowToDoInJava

Java example to evaluate xpath of an DOM org.w3c.dom.Document object and get results in form of String or NodeList. Evaluate XPath on DOM Create Document DOM object javax.xml.parsers.DocumentBuilder object. Create XPath from XPathFactory. Use xpath.evaluate(‘expression’, dom, resultType) to get result HTML. Program output: Where input xml file is: Happy Learning !!

Articles, dummyCategory

Java XPath Attribute Evaluate Examples – HowToDoInJava

Java examples to extract information from an XML document using XPath evaluational. We will learn to fetch information for matching attribute values, attribute values in range, xpath attribute contains() and so on. 1) XPath Attribute Expression Examples 1.1) Input XML file First look at the XML file which we will read and then fetch information …