| Recently Added Articles | Most Popular Articles | |
|
Activating and Deactivating EL evaluation in JSP
JSP Expression Language (EL) is useful and is evaluated in JSP pages by default since Servlet 2.4. However, sometimes we would not want to evaluate [ ... ]
Generic instance creation simplified with diamond operator (type inference)
Before Java SE 7, we have to write code to create new instances of generic types as follows: List<Integer> numbers = new ArrayList< [ ... ]
Using Strings in switch-case statement (Java 1.7)
Since Java SE version 1.7 (released on July 2011), developers can use Strings in the switch-case statement. This simple feature had been waiting for [ ... ]
Handling HTML form data with Java Servlet
Handling form data represented in HTML page is a very common task in web development. A typical scenario is the user fills in fields of a form and s [ ... ]
How to use log4j in Struts2
To use log4j in a Struts2 application, simply put log4j configuration file (log4j.properties or log4j.xml) under the root of the classpath. For a St [ ... ]
How to use log4j in Spring MVC
Log4j is a popular and widely-used logging framework for Java development. It’s pretty easy to setup and use log4j in a Spring MVC application, ju [ ... ] |
Code Example: File Upload Servlet with Apache Common File API
Following is code example of a sample Java web application that demonstrates how to implement file upload functionality based on Apache Common File [ ... ]
How to start FTP programming with Java
Although it is possible to use Java networking API (by using the interfaces and classes available in the packages java.net and javax.net) to write c [ ... ]
Upload files to a FTP server
To write Java code that uploads a file from local computer to a remote FTP server, the Apache Commons Net API is a preferred choice of developers. I [ ... ]
Show save file dialog using JFileChooser
Swing provides class javax.swing.JFileChooser that can be used to present a dialog for user to choose a location and type a file name to be saved, u [ ... ]
Download files from a FTP server
With the help of Apache Commons Net API, it is easy to write Java code for downloading a file from a remote FTP server to local computer. In this ar [ ... ]
List files and directories on a FTP server
This article describes steps for listing content of a directory on a FTP server using Apache Commons Net API. If you have not been familiar with FTP [ ... ]
An HTTP utility class to send GET/POST request
This article introduces a utility class that makes a connection to a HTTP server by sending a GET/POST request and receiving response from the serve [ ... ]
Upload files to database (Servlet + JSP + MySQL)
This tutorial shows how to implement a Java web application that uploads files to server and save the files into database. Table of content: C [ ... ]
Change working directory on a FTP server
While working with a FTP server using Apache Commons Net API, it’s important to keep in mind that many operations are working based on the working [ ... ] |