Posts Under 'Tutorials'

The request doesn’t contain a multipart/form-data or multipart/mixed stream, content type header is null

org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn’t contain a multipart/form-data or multipart/mixed stream, content type header is null If you are iterating the items from the multipart request without checking if an http request is encoded in multipart format then you will get this error. If ServletFileUpload.isMultipartContent(request) returns true then you need to get the fields via the […]

Read more »


Generating a Certificate Signing Request (CSR) for Jakarta Tomcat

Step 1: Prepare your Tomcat server If you are not using JDK 1.4 or higher, you must download and install “Java Secure Socket Extensions” JSSE. You can download JSSE from http://java.sun.com/products/jsse/. Step 2: Generate a Private Key Use the keytool command to create the private key file: keytool -genkey -keyalg RSA -keystore yourdomainname.key The following […]

Read more »


Conditional Advanced Search Using PHP and MySql

If you are working on an search page on a site where you have to search the keyword using the following conditions : 1. all the words 2. the exact phrase 3. at least one of the words 4. Without the words Then you have to use MySQL FullText Search with the Boolean Full-Text Searches […]

Read more »


Send Simple HTML email with JavaMail

Send Simple HTML email with JavaMail The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. This one is the simple program which can be used to send email with JAVA. import javax.mail.*; import javax.mail.internet.*; import java.util.Properties; class SimpleHTMLMail { public static void main(String[] args) throws Exception{ System.out.println("Sending mail…"); Properties […]

Read more »


Simple pagination in PHP using Mysql

This is the simple example about how to do pagination in PHP. /* Function to get simple query converted into pagination query */ function getPagingQuery($sql, $itemPerPage = 10) { if (isset($_GET['page']) && (int)$_GET['page'] > 0) { $page = (int)$_GET['page']; } else { $page = 1; } // start fetching from this row number $offset = […]

Read more »