Password Protected Zip File Download Using Spring REST Support

Zip

Download the project source code from here and run mvn clean install and mvn eclipse:eclipse to make the Eclipse project. Alternatively you can follow the following steps to create the web application. Step 1: In Eclipse, goto File > New > Maven Project and select "maven-archetype-webapp". A web application will be created. Step 2: Then overwrite the pom.xml ...

Reading XML using DOM Parser in Java

In this example we will use DocumentBuilder.parse() method to parse xml document. Let us take catalog.xml for this example: We will map the <book> elements to instances of Book.java Here is the example DomReader.java that will read catalog.xml and print books: Output:  

XML Validation with XSD in Java

XML is validated with XSD by calling Validator.validate() method. Let us take employees.xml for this example: Now we need to create employees.xsd that will be used to validate employees.xml. The following program can be used to validate employees.xml against employees.xsd:

JSP Custom Tag Example

JSP Custom Tag Example

What is JSP custom tag? JSP custom tag is user defined tag that performs user defined functionality. The use of custom tags greatly enhances the functionality and simplifies the readability of JSP pages. How to build custom tags? To build a custom tag follow the following steps: Step 1: Create the custom tag file RTag.java Step 2: Create the tag ...

Displaying XML with XSLT

employees.xml

XSLT stands for Extensible Stylesheet Language Transformations which is used to transform XML documents into other XML documents, for example XSLT can be used to transform and XML document into a HTML document and this HTML can be displayed by a browser. Here is an example XML document employees.xml If we open it in a browser then ...

Spring Framework Interview Questions

1. What is Spring? Spring is an open source Java based application development framework introduced by Rod Johnson. Spring is modular and light weight framework with IoC container, Struts, Hibernate integration support, full featured AOP and MVC support, etc. 2. What are the advantages of Spring framework? What are features of Spring? Spring is free and open source ...

JSP Interview Questions

1. What is JSP? JSP is a Java based view technology that generates dynamic content for the web pages. 2. Is JSP technology extensible? Yes. JSP technology is extensible by creating custom actions and custom tags. 3. What are the advantages of JSP over Servlet? JSP reduces the complexity of Servlet. JSP is easier to learn and code than Servlet. JSP does ...

Java Serialization Interview Questions

1. What is serialization and deserialization? Serialization is the process of writing the state of an object by converting it to a byte stream. De-serialization is the process of restoring an object from byte stream. 2. What is the need of Serialization? To send the state of an object over the network. To save the state of an object ...