SHARE
Facebook X Pinterest WhatsApp

JavaBoutique: Java Servlets Part 4: Handling Form Data

Jun 5, 2000
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



One of the nice features of Java servlets is that all of the form parsing is handled
automatically. In part 4 of Server-Side Web Applications Using Servlets and JSP, Marty Hall
covers URL-encoding, GET, POST, and all the rest.

“Extracting the needed information from this form data is traditionally one of the most
tedious parts of CGI programming. First of all, you have to read the data one way for GET
requests (in traditional CGI, this is usually via the QUERY_STRING environment
variable), and another way for POST requests (usually be reading the standard input).
Second, you have to chop the pairs at the ampersands, then separate the parameter names
(left of the equals signs) from the parameter values (right of the equals signs). Third, you
have to URL-decode the values. Alphanumeric characters get sent unchanged, but spaces
get converted to plus signs and other characters get converted to %XX where XX is the
ASCII (or ISO Latin-1) value of the character, in hex.”

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
6 Best Linux Virtualization Software for 2024
What Is a Network Policy Server (NPS)? | Essential Guide
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.